It is often necessary to display text or messages when certain conditions are met.

{if} statements in Smarty have much the same flexibility as PHP if statements.

Every {if} must be paired with a matching {/if}. {else} and {elseif} are also permitted.

All PHP conditionals and functions are recognized, such as ||, or, &&, and, is_array(), etc.


{if $filename eq "announcements.php"}
    This is the announcements page
    This is not the announcements page

For more information, please refer to