The 5.7 branch of Magnolia reached End-of-Life on December 31, 2023, as specified in our End-of-life policy. This means the 5.7 branch is no longer maintained or supported. Please upgrade to the latest Magnolia release. By upgrading, you will get the latest release of Magnolia featuring significant improvements to the author and developer experience. For a successful upgrade, please consult our Magnolia 6.2 documentation. If you need help, please contact info@magnolia-cms.com.
Templates are blueprints for creating pages, areas and components. When you add a page in the Pages app you must choose a template.
A template consists of:
Template definition | |
Template script | required A template script defines the output, typically HTML, and is interpreted by a Renderer. The script is written in a templating language such as FreeMarker or JSP. |
Dialog definition | optional Dialogs are used for content entry. A dialog defines the editable content properties of a template. Pages, area and component templates can all use dialogs. |
Model | optional The model is a JavaBean implementing |
Elements of the Magnolia template mechanism:
The diagram abbreviates the field class as i.m.u.f.f.d.TextFieldDefinition
to save space. This is not a valid value. Use fully-qualified field class names such as info.magnolia.ui.form.field.TextFieldDefinition
in your definitions.
The Magnolia CLI speeds up template creation for light developers. The tool provides commands that automatically create basic template definitions and scripts on the file system.