View Single Post
  #1  
Old 06-15-2004, 09:10 PM
 
Tye Tye is offline
 

eXpert
  
Join Date: Nov 2002
Location: Australia
Posts: 284
 

Default Smarty Syntax {elseif} - help needed

Hi guys

Hows it going?

I am having some problems getting some smarty syntax to work and was wondering if anyone has used something similar.

Here is what I have

Code:
{if $cat eq "1"} CONTENT 'A' {elseif $productid eq "11"} CONTENT 'B' {else} CONTENT 'C'

When I use this code - CONTENT 'A' and 'C' work fine - but content 'B' is ignored.

I pulled this of the smarty template site and the only difference I can see is that they use the $name throughout whereas I use $cat and $productid. If this is the problem, has anyone got any ideas on how to get around this?

Code:
{if $name eq "Fred"} Welcome Sir. {elseif $name eq "Wilma"} Welcome Ma'am. {else} Welcome, whatever you are. {/if}

Cheers

Tye
__________________
Today is a beautiful day, grab it while you can and live it to the full

Version 4.2.3 UNIX
Reply With Quote