Reputation: 7
I'm new to using the smarty template system and was hoping someone could help me with this.
If {$clientsdetails.customfields1}
is null OR blank, I want it to show the message "not working". If there's anything entered in that field, I want it to show the message "currently working".
Upvotes: 0
Views: 225
Reputation: 777
Try this:
{if empty($clientsdetails.customfields1)}
<p>Not Working</p>
{else}
<p>Currently Working</p>
{/if}
This will check if $clientsdetails.customfields1 is not set or if it equals false.
In PHP all of these are considered to be false:
If it is not set or == false, it will show 'Not Working' otherwise 'Currently Working'
Documentation for more Information: http://www.smarty.net/docs/en/language.function.if.tpl
Upvotes: 1
Reputation: 2049
Try this code:
{if $clientsdetails.customfields1==""}
not working
{else}
currently working
{/if}
Upvotes: 0