0 users online. Create an account or sign in to join them.Users

Overview

Utilities are self-contained, reusable XSLT stylesheets that can be included or imported by page templates and by other utilities. They are often used to perform common formatting tasks (working with dates and times, for instance) or to render widely-used interface elements (such as a navigation or a footer).

As a concept, utilities are not unique to Symphony, but are a well established XSLT technique adopted to enable users to create modular, robust templating layers for their Symphony projects.

Usage

Utilities can be managed in the Components view (Blueprints > Components), or by editing the XSLT stylesheet file directly (workspace/utilities/utility-name.xsl).

Utilities must be explicitly included by page templates in order to be applied.

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

The ../utilities is necessary when including a utility from a page template because the pages/ directory is adjacent to the utilities/ directory in the workspace.

Utilities can also be included by other utilities, like this:

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

Details

Utility Editor

Utility Editor

The utility 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

Utilities are essential to keeping front-end markup lean and efficient. Any bit of XSLT that is applied across multiple pages is a candidate for being abstracted for reuse as a utility. Symphony’s website has a growing library of utilities available for download.

Screenshots

Code Samples

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.1
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details