Magnolia 4.5 reached end of life on June 30, 2016. This branch is no longer supported, see End-of-life policy.
Web pages created with Magnolia are based on templates. Templates ensure that page structure and presentation remain consistent while the content varies from one page to another. For example, an event template helps you generate event pages that look and feel the same but display a different event each.
The system generates pages by merging a template with corresponding content from the repository. The position and inclusion of each page element is defined by the page template. The template allows authors to choose from a number of different components in a single area of the page.
Note! The diagram shows the detailed JCR view on the left. This is not how authors see content. The user interface for authors and editors hides much of the complexity, providing a user-friendlier way to manage pages, areas and components.
titlerendered as an H1 element on the page, "Bulls and the Thunder Make a Stand".
authorrendered on the dateline.
abstractto provide an introductory paragraph.
maincollection which contains components.
subtitleelement "THUNDER 101, LAKERS 96".
Magnolia templating mechanism consists of the follow components:
Below you find a more detailed map of relationships between the elements that make up the template mechanism. Starting at the top left corner, a template definition defines the template script used to render the content. The location of the script is given in the
templateScript property. The template definition also assigns a dialog definition in the
dialog property. The dialog definition is a group of configuration nodes just like the template definition. It defines what tabs and fields should be present in the dialog.
The template definition further defines a
modelClass. Model is a Java program that holds your business logic. The model can do any task required such as execute a Google search or calculate an insurance policy. It holds the results of the logic execution and passes them to a renderer.
The renderer includes the results on the page as instructed by the template script. The script tells the renderer where to place the content. It contains placeholders for content attributes such as headings, images and the results of the business logic execution.
A Web page is the output of the rendering process where template and content are combined.
The following class diagram shows the relationships between the objects collaborating in rendering of a template.