Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

css - How to create custom HTML Elementor wrapper section?

I have created several sections with plain HTML and CSS that I would like to use as "wrapper" sections for my clients to be able to populate using Elementor drag and drop interface. I have tried to do this creating a custom Elementor widget, but there is no "Controls_Manager::NAME_OF_CONTROL" that I could find that would correspond to an Elementor section or inner section. (Controls_Manager::WYSIWYG is actually just a text editor).

I've also tried creating an elementor section template that has two HTML blocks: one above and one below an empty elementor section. Like this:

[-------- begin HTML (Elementor or Wordpress type) block ----------

<div class="myOpeningSectionDiv"> <!-- no, it's not just a single div, I'm using opening div as an example here for brevity -->

-------- end first HTML block --------------------]

[----- standard empty Elementor block with the little + button goes here ---------]

[-------- begin second HTML (Elementor or Wordpress type) block ----------

</div>

-------- end second HTML block -------------]

This does not work, because Elementor wraps those custom HTML blocks in its own html tags which breaks things.

The closest I solution I could find is creating two templates. One template is the contents simple Elementor drag and drop contents that the client can edit. The second contains just one custom HTML block with a short-code pointing towards the first template. The client would then insert that into their page. This is not ideal because 1) When you preview the page, the contents of the shortcoded section do not show up, and 2) they have to edit that section separately from the rest of the page in the templates area and can't create other sections like it without messing with HTML directly or getting me involved.

I've been searching the internet for two days for a solution and came up short. Is this possible to do?

And no, I don't think I can use a theme page template, because I need them to be able to drag and drop other sections with elementor above and below this section.

To summorize I'm trying to do this:

[Some elemnentor drag and drop content]

<someCustomReusableHtmlIWroteHere>
   [Section where you can drag and drop buttons, text, form, etc using Elementor]
</someCustomReusableHtmlIWroteHere>

[Some more elemnentor drag and drop content]

I hope I'm explaining this correctly. As far as software used: latest Wordpress and Elementor Pro.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...