BASICS

ADMINISTRATION

DEVELOPMENT

SUPER ADMIN

  LAST UPDATED
11/27/2013

Templates: TMPL Reference

The TMPL file is an XML file that typically includes XML, XHTML, OU Campus tagging, and the Echo Variable and Set Variable elements. Predefined variables can be used in .tmpl files to echo, or print, values relating to directory names, includes, and site name. This allows the TCF to pass a value and the TMPL to use it in their combined effort to manufacture a PCF. These predefined system 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. They can be useful for utilizing recursive includes for, say, a breadcrumb trail. 

Echo Variable Tag

The value of a variable gets "echoed" or "printed" into a new file being created. Note that there is not a space between the first comment tag and the percent sign.

Syntax

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

Example

<meta name="keywords" content="<!--%echo var="metakey" -->">

 

Attributes

  • encoding

  • var


 

Current Date Variable

The current date variable outputs the current date and time at the time of page creation.   

Syntax

<!--%echo var="currentDate" -->

Example Usage

<parameter name="datetime" prompt="Date created" alt="Date created.">
<!--%echo var="currentDate" --></parameter>

Example Output

<parameter name="datetime" prompt="Date created" alt="Date created.">Wednesday, November 27, 2013 8:59:12 AM PST</parameter>

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">

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">

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">

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>

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.

Set Variable Tag

Defines a new variable within a TMPL.

Syntax

<!--%set --> 

 Example

<meta name="keywords" content="<!--%set var="metakey" -->">

 

Attributes

  • var (Required)


 

 

 

 

 

 

 

 


Was this page helpful?

Additional Comments:


(Include your email address if you would like a reply)

Procede to http://support.omniupdate.com/