Sections are the outermost child element of a dnd_area. Sections can be made reusable through section templates or saving them within the page editor.
dnd_area
, with the dnd_section
tag.
The styling options available in the editor are available when coding a template as well. For example:
dnd_area
.
templateType: section
in their template annotation.
Parameter | Type | Description | Value |
---|---|---|---|
templateType | String | Sets the template type used to determine where the template can be used and what data is available to it. | section |
label | String | Used in the page editor to provide a human readable name of the section. | |
description | String | Further description of the section beyond what you can do with a label. Displays in the page editor. 255 characters maximum. | |
screenshotPath | String/path | Path to a screenshot of the section. This is used to give content creators an easy visual reference for what the section looks like. |
dnd_section
tag. Only one dnd_section
can exist within a section template. Inside of that section, you can place modules, rows and columns, following the same dnd_area
rules that apply when adding a dnd_area to a page template. The exception is that you are defining the content for just a section and its child drag and drop elements.
dnd_area
by using a include_dnd_partial
tag. This tag provides the path pointing to the section file, as shown below:
include_dnd_partial
tag. This allows you to pass instance specific variables from the page template to the section, overriding the default values in the section file. See section context for more information.context
parameter in the include_dnd_partial
tag.
context
parameter will become available to reference within your section template. The following example shows how to set the image URL and rich text area and button content set in context if it exists.
||
OR filter to provide fallback default content if none is provided. For example, in the button module, if context.buttonText
has a value, the page will use it. Otherwise, the text is set to Subscribe
.dnd_area
which calls your section template using a include_dnd_partial
tag. In the top right corner click preview. This way you can keep updating your section and see your changes reflected right away. This is much more efficient than having to create a new page for each change you make.
?developerMode=true
.