Section
A section
belongs to a theme and a category.
When an content editor adds a section within a page, Maglev creates an unique instance of the section based on its definition. This instance will store the content (text / image / links / ...etc) written by the content editor.
The section definition tells to the Editor UI how to build the content form.
When you genarate a new section through a Rails generator, you end up with the following folder structure.
The id of a section is the base name of their definition file name. Example: heroe_01 for heroe_01.yml.
Definition file
Template
Inside your section template file, you'll have access to a variable named maglev_section
exposing the content written by the editors.
This variable owns a couple of attributes / methods.
The section must be wrapped by a single HTML node (DIV, SECTION, ...etc). This node will carry some important information about the section required by the UI editor. Those information are very important in order to refresh its content.
You've got also the ability to not use our helpers and write plain HTML code instead. The example above can be also written like the following way:
Last updated