User's Manual

480 | Reference Dell Networking W-ClearPass Guest 6.4 | User Guide
Class Name Applies To Description
nwaImportant All Text that should be prominently displayed
Table subheadings
nwaUsername All Text used to display a username
nwaPassword All Text used to display a password
Smarty Template Syntax
Dell Networking W-ClearPass Guest’s user interface is built using the Smarty template engine. This template
system separates the program logic and visual elements, enabling powerful yet flexible applications to be built.
When customizing template code that is used within the user interface, you have the option of using Smarty
template syntax within the template. Using the programming features built into Smarty, you can add your own
logic to the template. You can also use predefined template functions and block functions to ensure a
consistent user interface.
Basic Template Syntax
Following is a brief introduction to the usage of the Smarty template engine. For more information, please
refer to the Smarty documentation at http://www.smarty.net/docs.php, or the Smarty Crash Course at
http://www.smarty.net/crashcourse.php.
Text Substitution
Simple text substitution in the templates may be done with the syntax {$variable}, as shown below:
The current page’s title is: {$title}
Template File Inclusion
To include the contents of another file, this can be done with the following syntax:
{include file="public/included_file.html"}
Smarty template syntax found in these files is also processed, as if the file existed in place of the {include} tag
itself.
Comments
To remove text entirely from the template, comment it out with the Smarty syntax {* commented text *}. Be
aware that this is different from an HTML comment, in that the Smarty template comment will never be
included in the page sent to the Web browser.
Variable Assignment
To assign a value to a page variable, use the following syntax:
{assign var=name value=value}
The value” can be a text value (string), number, or Smarty expression to be evaluated, as shown in the
examples below:
{assign var=question value="forty plus two"}
The question is: {$question}
{assign var=answer value=42}
The answer is: {$answer}
{assign var=question_uppercase value=$question|strtoupper}
THE QUESTION IS: {$question_uppercase}