HOME | DOWNLOAD | SUPPORT | INSTALLATION | FAQ | SUPPORT FORUM | DEMO
 ° Forums ° Statistics ° Registration ° Search ° Manual °
SkaLinks Forum / General Discussions / templating if/else conditional
Author Message
winstonford
Member

Posted: 19 Jul 2006 16:46:29


I want to use different background image depending on what category is being diplayed. How would I use an if/else conditional in smarty to accomplish this?

thx,
W

skalinks
Admin

Posted: 20 Jul 2006 23:02:43


Hi winstonford

You can use this condition

{if $cat_navigation.title == 'Title category'}
some output
{else}
other output
{/if}


Thank's

winstonford
Member

Posted: 21 Jul 2006 13:12:49


Thank you, this makes sense. It is what I was trying. For some reason it does not work. May be spaces in the title, I am not sure. How would I use the category id?

winstonford
Member

Posted: 21 Jul 2006 13:29:06


Changing the variable to $_output.cat_info.Title is successful:

{if $_output.cat_info.Title == 'Title category'}
some output
{else}
other output
{/if}