[solved] News {If then else} Statement not working in v1.11
Posted: Sat Aug 11, 2012 11:47 am
Hi
I want to replace main news title with a custom title2 if exist. As per C Arasmo's solution my code is shown below. But the news module is not showing the main news title when title2 is empty. It would be nice if someone give me a working solution. Thank you.
I tried another way, but this one also not working.
I want to replace main news title with a custom title2 if exist. As per C Arasmo's solution my code is shown below. But the news module is not showing the main news title when title2 is empty. It would be nice if someone give me a working solution. Thank you.
Code: Select all
{foreach from=$items item=entry}
{if $entry->fieldsbyname.title2 != ''}
{$entry->fieldsbyname.title2->value}
{else}
{$entry->title|cms_escape}
{/if}
{/foreach}
I tried another way, but this one also not working.
Code: Select all
{foreach from=$items item=entry}
{if $entry->fieldsbyname.title2 != ''}
{$entry->fieldsbyname.title2->value}
{else if $entry->fieldsbyname.title2 == ''}
{$entry->title|cms_escape}
{/if}
{/foreach}