Predefined Variables Reference


Predefined variables can be used in .tmpl files to echo, or print, certain parameters relating to directory names, includes, and site name directly onto the page. These variables come in particularly handy when needing to dynamically create a path to the root of the site or any other area of the site; you will find them most useful when utilizing recursive includes for, say, a breadcrumb trail.

 



Common Tree Variable

Prints the name of the current directory.

Syntax:
<!-- %echo var="commontree" -->

Example:
<a href="/<!--%echo var="commontree" -->/index.html">

Parameters

  1. var (Required)

Current Variable

Prints a path to the current directory from the root of the site.

Syntax:
<!-- %echo var="current" -->

Example:
<meta name="keywords" content="<!--%echo var="current" -->">

Parameters

  1. var (Required)

Directory Variable

Prints a path to the current directory from the root of the site, followed by a slash.

Syntax:
<!-- %echo var="directory/" -->

Example:
<a href="/<!--%echo var="directory/" -->index.html">

Parameters

  1. var (Required)

Includes Variable

Prints the path from the site root to the parent directory and adds a trailing "includes" directory (i.e., "currentdir/includes").

Syntax:
<!-- %echo var="includes" -->

Example:
<a href="<!--%echo var="includes" -->/leftnav.html">

Parameters

  1. var (Required)

Parent Variable

Prints the path from the site root to the directory that contains the current directory (i.e., one directory "above" the current location).

Syntax:
<!-- %echo var="parent" -->

Example:
<a href="/<!--%echo var="parent" -->index.html">

Parameters

  1. var (Required)

Relative Root Variable

Prints the relative path from the current directory to the staging root (i.e., "../../currentdir/"). This variable is particularly useful when used in PCFs or utilized in XSL transformations.

Syntax:
<!-- %echo var="relativeRoot/" -->

Example:
<config><!--%echo var="relativeRoot/" -->resources/config/standard.xml</config>

Parameters

  1. var (Required)

Site Name Variable

Prints the name of the current site (determined by an administrator).

Syntax:
<!-- %echo var="sitename" -->

Example:
This page is part of the <!--%echo var="sitename" --> site.

Parameters

  1. var (Required)