F2C Smarty code (snippets)

Hiding empty fields (IF ELSE)

The Smarty template engine has made life very easy for us. Using the IF statement we can check IF a field has a value.

In this case IF actually means "if the field has a value than show .... whatever is between the IF tags."

The basic Smarty syntax is:

{if $FIELDNAME}
 ..... any text/html/plugin code including the actual field data {$FIELDNAME} ....
{/if}

Including ELSE

{if $FIELDNAME}
  ..... any text/html/plugin code including the actual field data {$FIELDNAME} ....
 {else}
..... Notice: You did not fill out the field called XXXXXX
{/if}