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.
A template script is a mixture of:
- Static markup
- Dynamically assigned values provided by
TemplatingFunctions
and other convenience helpers - Content references
FreeMarker
At Magnolia, we prefer FreeMarker for its flexibility, clean syntax and practical error reporting.
Magnolia 5.7 includes FreeMarker version 2.3.38. You can use the .version
special variable in a template to check this.
If you are not familiar with FreeMarker, these links will get you started:
- FreeMarker manual
- FreeMarker quick start guide to templating
- FreeMarker built-ins are the
?
bits that follow expressions and provide useful functionality. - FreeMarker directives are the
[#blocks]
of code which are similar to JSP tags.
For further information about how to use Freemarker in the Magnolia context, also read:
The Magnolia CLI offers the create-page
and create-component
commands that automatically create basic scripts, template definitions and dialog definitions.
Overview
Content Tools
Apps
Activity