Magnolia 4.5 reached end of life on June 30, 2016. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

Page is the highest level template. Pages are the building blocks of the site hierarchy visible in AdminCentral. Each part of the site URL is also a page. For example, bikeshop.com/products/bicycles would have at least three pages: a home page, a products section page, and a bicycles page. Pages consist of areas which can consist of further areas or components.

STK

The STK contains a number page templates:

The Demo Project Home page is based on the stkhome template and contains Stage, Teasers, Base and Promos areas.

When an editor adds a new component to an area, the available components are based on that area type:

Module pages

Many Magnolia modules come with page templates. For example:

Page definition

A page definition configures the properties of the page template. It is similar to the component definition ; both template types use the same template definition object: ConfiguredTemplateDefinition . In addition, pages and components reference their dialogs using the same path syntax and are rendered using the same renderer. You can find page definitions in the <module name>/templates/pages folder in AdminCentral.

Properties

Property

Description

Valid values

Mandatory

renderType

The renderType determines which renderer to use. Magnolia supports JSP and Freemarker renderers by default but you can add your own. For STK pages the type is stk. The STK module also defines its own page renderer, STKRenderer.

jsp
freemarker

Yes

templateScript

The templateScript sets the path to the template script used by the page. You can store scripts on the file system of the webapp, in the templates workspace, or in the webapp's classpath.

A valid Magnolia path.

Yes

dialog

The dialog identifies the page properties dialog.

The value has two parts. The first part before the colon (:) is the name of the module folder where the dialog definition resides. The second part is a relative path. Example: templating:pageProperties

No

description

Page description. Type a literal value or retrieve the value from a message bundle using a key. The message bundle is defined in the i18nBasename property.

No limitations. Conventional alphanumeric characters are recommended. Otherwise a properly defined key.

No

i18nBasename

Message bundle used for the page.

Any properly defined message bundle. This value should match the message bundle set in the dialog definition.

No

class

Defines the concrete Java class to instantiate. For STK page templates the class is info.magnolia.module.templatingkit.templates.pages.STKPage.

Fully-qualified class name. This property needs to be in appropriate Magnolia class syntax.

No

modelClass

A Java class that contains business logic for the page. The model class needs to implement the RenderingModel interface. The renderer creates a bean based on the modelClass. Current content, definition and the parent model are passed to the constructor. This object is instantiated for each rendering of a page or component.

Fully-qualified class name. This property needs to be in appropriate Magnolia class syntax and specifically refer to the modelClass for the page.

No

title

Title of the page. You can type a literal value or retrieve the value from a message bundle using a key. The message bundle is defined in the i18nBasename property.

If typed, no limitations. Conventional alphanumeric characters are recommended. Otherwise a properly defined key.

No

bodyID

The id attribute of the HTML body element. It identifies the page template, for example home, section or article. The ID allows you to style pages differently while still using a single CSS file.

 

No

category
subcategory

Assigns the page to a category such as feature. The category is used to control template availability, assist in content aggregation or identify the site root.

 

No

visible

Makes the page template available to editors.

true (default)
false

No

extends

Inherits the configuration from another page definition. See Extending configuration .

A valid Magnolia path.

No

In the page definition skeleton below, mandatory properties are red while optional properties are black.

Read more about pages in the  Introduction to templating tutorial.

  • No labels