Jul 30, 202410:32 AM - edited Jul 30, 202410:37 AM
Participant
Drag and drop area with pre-populatd modules
SOLVE
Hi there!
I want to be able to create a very simple solution of a drag and drop area with several pre-chosen modules. I want the end user then to be able to re-order these, delete and add others in if needs be. All the modules are full width, row by row.
But what I find is that when I drag and re-order the modules in the page editor, new empty sections are created (with a "Drop Modules here" message) - Have I got the markup wrong here?
First what @Gracjan has said is correct. To paint a little more context around that answer, when using the dnd_section tag your're essentially creating a container or structure for modules and other structural elements. So by moving a module out of a section it will create another section and leave the empty section. You could use a single dnd_section like so:
Using the single section with a cilumn and rows will eliminate any additional structure being added to the layout. Though this will not stop the user from dragging modules into columns.
If you intention is to restrict users to the vertically stacked full width modules I might suggest a single module with a repeater that has a number of defaults that correlate to the modules you want them to use. This solution would allow them to add "modules", rearrange them vertically, and restrict column creation. I will preface this with: It is possible but not recommended. I would instead implement a authoring process and a approval process.
If you have any questions please don't hesitate to reach out!
First what @Gracjan has said is correct. To paint a little more context around that answer, when using the dnd_section tag your're essentially creating a container or structure for modules and other structural elements. So by moving a module out of a section it will create another section and leave the empty section. You could use a single dnd_section like so:
Using the single section with a cilumn and rows will eliminate any additional structure being added to the layout. Though this will not stop the user from dragging modules into columns.
If you intention is to restrict users to the vertically stacked full width modules I might suggest a single module with a repeater that has a number of defaults that correlate to the modules you want them to use. This solution would allow them to add "modules", rearrange them vertically, and restrict column creation. I will preface this with: It is possible but not recommended. I would instead implement a authoring process and a approval process.
If you have any questions please don't hesitate to reach out!
This behaviour is normal. When you reorder the modules and you move one module from one section into the another one, the origin section remains empty. That's why you are seeing the "Drop Modules here" message. It's actually not creating a new one since you are only re-ordering the module (what's inside the section), not the section itself.