Customizing Block(section block) While Dragging it
Question
Hi I have seen that there was two separate blocks to add 'sections' and 'columns'.We have a flow like when we drag a section into canvas need to show a popup on that we manually able select the section to be one column section/two column section,how do we achieve this.
And also we have seen the method editor.on('component:selected' which is triggered while dropping the block ,Is we need to use this to customize the section separation then how we do this.
Thanks in advance
Answers (3)
If your sections always require 1 or 2 columns, why not remove the section and column blocks, instead, add new blocks for "section with 1 column" and "section with 2 columns" and save the popup?
Yeah it is possible only .But we have the requirement that we need to show single section to customer and based their pick in popup only we need to split it.
Ok. In that case, it's the canvas:drop event. Hook into that, check it's a section and open your modal. I'm not sure on how you insert the columns but hope this helps.
editor.on('canvas:drop', (dataTransfer, model) => {
if (model.is('section')) { // <-- might not be called 'section'
// Open your modal and do your thing...
}
});
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1303
I need to add carousel block with flex slider
Hi, artf I would like to add some new block with custom slider when user dragged the slider into canvas need to show some popup with availa...
Issue #1822
[QUESTION] - Add style sector for specific Css rule
Hey @artf , COuld you give your help on this one? I want to disable the user to able to select the wrapper block (body) but I still want to...
Issue #1576
Select element that has several blocks as one unit.
I've created new block (like form or dialog, etc) that has several blocks such as search box, button, text fields, ... This element doesn't...
Issue #861
[Question] Help adding images to the canvas
I've followed the docs and have been able to upload images. When I drag an image block (using the newsletter preset) and select an image fr...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.