Ecommerce Shopify WordPress Discussion

Is a custom "Row" Element for WPBakery (Visual Composer) possible?

I've developed some Elements for the WPBakery Editor and getting better with it. But now I have an idea that I'm not sure if it is possible. I'd like to build an Element that behaves like the "vc_row" Element, so that if placed in backend it is not nested inside a row automatically. The background of the problem is (as usual) my customer. The Element should be a "Header" element that is always stretched over the whole page. At the moment my customer needs to add the element, than click on "edit row" and select "stretch row and content" from the dropdown. My Idea is that instead of doing this the element is automatically nested inside a structure that is stretched. So either the row element must change it's stretching-behaviour based on the nested content (my header-element) or my Element needs to behave like a row itself. Are there any solutions or ideas for this? I've read lots of tutorials and of course wpbakery dev manuals but I don't have a clue how to solve the problem. +++ UPDATE / Solution +++ I've found out that if you unminify the code of "assets > js > dist > backend.min.js" in "js_composer" plugin directory and look into line 1408 you will find the following code with two occurences of "vc_section", which is the only "root container" that comes with wpbakery: (e = e.closest("[data-preset]")) && (preset = e.data("preset"), presetType = e.data("element")), !1 === this.model ? (window.vc.storage.lock(), "vc_section" === tag ? (e = { […] && "vc_section" === presetType You can change these lines and add your own element here. Example: If your Element is called "vc_carousel_father" you add an OR-condition. Just replace "vc_section" === tag with ("vc_section" === tag || "vc_carousel_father" === tag) and "vc_section" === presetType with ("vc_section" === presetType || "vc_carousel_father" === presetType) After that your Element "vc_carousel_father" behaves like a root-container. Keep in mind that you also have to add the following parameters to your vc_map function in order to make your container draggable on root level: 'as_child' => array( 'only' => '', // Can only be placed in root ), 'class' => 'vc_main-sortable-element', Important: To do this you have to modify a core-file of WPBakery. After an update your modifications might be gone or WPBakery stops working. +++ How to improve? +++ If anyone has a good concept how to handle this without the need of a modded core-file I would appreciate your ideas! In the meantime I'm searching for a solution on my own and will give another update if there is one. My current idea is to add a new parameter to my elements with a true/false option "is root" or something like that. Then maybe there is a chance to hook something in via the "admin_enqueue_js" parameter of wpbakery.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.