Edit on GitHub

Parameters

Parameters channel dynamically set values through the system for use by data sources and in the templating layer.

Overview

Parameters are attribute-value pairs that are made available to your Symphony project’s front end pages. They allow dynamically-set values to be channeled through the system for use by data sources or in the templating layer. Parameters are commonly used to filter data sources using dynamic values or to access contextual information (like the current date) from within page templates.

There are three types of parameters, grouped according to how their values are set. System parameters are generated by the system and contain useful contextual information such as the current date and time or the current page handle. Data source output parameters are created on the fly by a data source using values from a field in its result entries. URL Parameters are defined in a page’s configuration and their values are set dynamically in a its URL.

Collectively, the parameters available to a page are referred to as the “parameter pool.”

Usage

With Data Sources

Parameters can be referenced in the data source editor—in filter rules, result limit settings, and pagination settings—using XSLT's attribute value template syntax: {$parameter-name}.

Data sources also have a “”Required URL Parameter setting, but the syntax is slightly different. Because this setting refers to the parameter itself and not to its value, curly braces are not used: $parameter-name.

In the Templating Layer

Parameters can be referenced in page templates and utilities, either by using the attribute value template ({$parameter-name}) or—because the parameter pool is included in a page's XML source—using XPath.

Details

Parameter Pool

Parameter pool refers to all the parameters available to a page. These are accessible via the page environment (and used as described above), or—as of version 2.0.7—in the page's XML source.

System Parameters

Below is a listing of all global system parameters.

Parameter | Description | Example --------- | ----------- | ------- today | The current date | 2009-11-30 current-time | The current time | 19:09 this-year | The current year | 2009 this-month | The current month | 11 this-day | The current day of the month | 30 timezone | The system timezone offset | +10:00 website-name | Website name as set in /manifest/config.php. | Blue Ninja Bakery page-title | The current page's title | The Ninja Way root | Root URL of the installation | http://blue-ninja-bakery.com workspace | URL of the worspace directory | http://blue-ninja-bakery/workspace root-page | Handle of the highest-level ancestor to the current page | about current-page | Handle of the current page | the-ninja-way current-page-id | ID of the current page | 12 current-path | Path to the current page, exclusing root | /about/philosophy/the-ninja-way parent-path | Path of parent pages | /about/philosophy current-url | Full URL of the current page | http://blue-ninja-bakery/about/philosophy/the-ninja-way upload-limit | Current site's upload limit as set in /manifest.config.php | 5242880 symphony-version | Version of Symphony installed | 2.0.7 site-mode | Either "live" or "maintenance" depending on whether Maintenance Mode is enabled | live cookie-username | Username of currently authenticated author, if applicable | admin cookie-pass | Hashed password of the currently authenticated author, if applicable | -

Sample XML Output

  <parameters>
    <today>2009-11-30</today>
    <current-time>19:09</current-time>
    <this-year>2009</this-year>
    <this-month>11</this-month>
    <this-day>30</this-day>
    <timezone>+10:00</timezone>
    <website-name>Blue Ninja Bakery</website-name>
    <symphony-version>2.0.7</symphony-version>
    <upload-limit>5242880</upload-limit>
    <root>http://blue-ninja-bakery.com</root>
    <workspace>http://blue-ninja-bakery.com/workspace</workspace>
    <page-title>The Ninja Way</page-title>
    <root-page>about</root-page>
    <current-page>the-ninja-way</current-page>
    <current-page-id>12</current-page-id>
    <current-path>/about/philosophy/the-ninja-way</current-path>
    <parent-path>/about/philosophy</parent-path>
    <current-url>http://blue-ninja-bakery/about/philosophy/the-ninja-way</current-url>
    <cookie-username>admin</cookie-username>
    <cookie-pass>7415346ecbf1c95e6894b23456a320e</cookie-pass>
    <site-mode>live</site-mode>
  </parameters>

The Big Picture

The ?debug interface, provided by the debug devkit extension, provides a list of all the parameters available to a given page and their assigned values.