
444
| Reference
ClearPass Guest 3.9 | Deployment Guide
Comments
To remove text entirely from the template, comment it out with the Smarty syntax
{*
commented text *}
.
Note that this is different from a 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}
Conditional Text Blocks
To include a block of text only if a particular condition is true, use the following syntax:
{if $username != ""}
<tr>
<td class="nwaBody">Username:</td>
<td class="nwaBody">{$username}</td>
</tr>
{else}
<!-- No user name, no table row -->
{/if}
The condition tested in the
{if} … {/if}
block should be a valid PHP expression. Note that the
{else}
tag does
not require a closing tag.
Script Blocks
The brace characters
{
and
}
are specially handled by the Smarty template engine. Using text that contains
these characters, such as CSS and JavaScript blocks, requires a Smarty block
{literal} … {/literal}
:
<script type="text/javascript" language="JavaScript">
{literal}
<!--
function my_function() {
// some Javascript code here
}
// -->
{/literal}
</script>
Failing to include the
{literal}
tag will result in a Smarty syntax error when using your template. Single
instances of a
{
or
}
character can be replaced with the Smarty syntax
{ldelim}
and
{rdelim}
respectively.
Repeated Text Blocks
To repeat a block of text for each item in a collection, use the
{section} … {/section}
tag:
{section loop=$collection name=i}
<tr>
<td class="nwaBody">
{$collection[i].name}
</td>
</tr>
{sectionelse}
Содержание ClearPass Guest 3.9
Страница 1: ...ClearPass Guest 3 9 Deployment Guide ...
Страница 32: ...32 Management Overview ClearPass Guest 3 9 Deployment Guide ...
Страница 178: ...178 RADIUS Services ClearPass Guest 3 9 Deployment Guide ...
Страница 316: ...316 Guest Management ClearPass Guest 3 9 Deployment Guide ...
Страница 328: ...328 Report Management ClearPass Guest 3 9 Deployment Guide Figure 46 Components of the Report Editor Report Type ...
Страница 410: ...410 Administrator Tasks ClearPass Guest 3 9 Deployment Guide ...
Страница 414: ...414 Administrator Tasks ClearPass Guest 3 9 Deployment Guide ...
Страница 423: ...ClearPass Guest 3 9 Deployment Guide Hotspot Manager 423 ...
Страница 440: ...440 High Availability Services ClearPass Guest 3 9 Deployment Guide ...
Страница 518: ...518 Index ClearPass Guest 3 9 Deployment Guide ...