Edit on GitHub

Page Templates

Page Templates transform the XML provided to a page by its data sources.

Overview

Page Templates are XSLT stylesheets that are coupled with a Symphony project’s pages and are used to transform the XML provided by the page’s data sources. Page templates are most often used to output XHTML, but they can also output other formats such as RSS-, Atom-, or SOAP-flavored XML, or non-XML formats like CSS and JavaScript.

Usage

Page templates are automatically generated whenever a page is created. They can be edited either using the page template editor in the admin interface or by editing the XSLT stylesheet file directly.

In the admin interface, the page template editor can be accessed by clicking the template's file name in the "Templates" column of the Pages index view (Blueprints > Pages), or directly from the corresponding page's edit form (by clicking the blue "Edit Template" button).

Details

Page templates must be well-formed XSLT stylesheets.

Page Template Editor

The page template editor is fairly basic. It consists of a single, large text area containing the whole of the XSLT stylesheet. On the right side of the editor is a list of all utilities in a project. Any utilities included in the current stylesheet are highlighted (when the xsl:include tag is first added, the text area must lose focus before the highlighting will apply).

The Big Picture

Page templates can dynamically include utilities by calling them at the beginning of the stylesheet, before any xsl:templates are declared:


  <xsl:include href="../utilities/utility-name.xsl" />