Dell PowerConnect W Clearpass 100 Software 3.7 Deployment Guide - Page 366
Comments, Variable Assignment, Conditional Text Blocks, Script Blocks, Repeated Text Blocks, else} - engineer
View all Dell PowerConnect W Clearpass 100 Software manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 366 highlights
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 != ""} Username: {$username} {else} {/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}: {literal} {/literal} 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} {$collection[i].name} {sectionelse} 366 | Reference Amigopod 3.7 | Deployment Guide