Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
...
Table of Contents | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
Code Pro |
---|
your-light-module/ └── templates └── pages ├── rhino.ftl ├── rhino.js └── rhino.yaml |
This recipe works for both page and component templates.
...
With this approach you do not have to follow the naming convention
...
. This can be handy
...
to use the same model
...
among multiple templates.
...
Instead of the property modelClass
, you must set the properties class
and modelPath
. The value for the former must be info.magnolia.module.jsmodels.rendering.JavascriptTemplateDefinition
and for the latter the path to the JavaScript model.
Example:
Code Pro | ||||
---|---|---|---|---|
| ||||
templateScript: /your-light-module/templates/pages/rhino.ftl
renderType: freemarker
|
...
class: info.magnolia.module.jsmodels.rendering. |
...
JavascriptTemplateDefinition modelPath: /your-light-module/templates/common/baseModel.js |
...