Simple variables

Link with href context
Name: {$user.name}
Last name: {$user.last_name}
Email: {$user.email}
{$js}

Context

Print 'test' GET variable: {$context.get.test.default("test variable not set")}

Easy way to check if variables are set or empty

{if $context.get.test}

Context GET variable EXISTS

{else}

Context GET variables IS EMPTY

{endif}

Modifiers

Date management: {$now.toLocal().date("Y-m-d h:i a")}

Name: {$user.name.upper()}
Nickname: {$user.name.lower().if("admin", "administrator", $user_role).capitalize()}
Extra: {$user.extra.truncate(20)}

Modifiers with errors

Can't sha1() a date object: {$now.sha1()}

Or when missing a required parameter: {$user_role.truncate()}

Custom modifier

{$user.name.myModifier("Hello ", " goodbye")}

Control structures

If conditionals

{if $user_role.upper() eq "ADMIN"}

Welcome Administrator

{elseif $user_role.upper() eq "MEMBER" or $user_role.upper() eq "TEAM"}

Welcome member of the community

{else}

You are not a registered user

{endif}

Which is the same as doing it with macros

Welcome Administrator

Welcome member of the community

You are not a registered user

Loops

There are no users

{include footer.html}