Re: [SMARTY-GENERAL] If statements

From: Date: Mon, 01 Apr 2002 18:36:14 +0000
Subject: Re: [SMARTY-GENERAL] If statements
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-3419@lists.php.net to get a copy of this message
Hey Monte, We do the following $tplassigns[] = array( 'ID' => $RESULT24->fields['SECTID24'], 'CATEGORY_ID' => "", 'NAME' => $NAME, 'IS_SECTION' => "Y" ); $tpl->assign( 'SECTIONS', $tplassigns ); So how would I reference that, IS_SECTION? {if $SECTION.IS_SECTION eq "Y"} Thanks, Brad Atkins Manager, Technical Development Sales: 1-877-973-2278 Support: 1-877-973-4968 Email: brad@youreshop.com ----- Original Message ----- From: "Monte Ohrt" <monte@ispi.net> To: "Brad Atkins" <brad@youreshop.com> Cc: <smarty-general@lists.php.net> Sent: Monday, April 01, 2002 1:20 PM Subject: Re: [SMARTY-GENERAL] If statements > You can't nest template tags, that is against syntax rules. This is in > the FAQ. > > do this: > > {if $var eq "Y"} > > > Monte > > Brad Atkins wrote: > > Hello, > > > > I have the following code: > > > > [foreach item=SECTION from=$SECTIONS] > > > > [$SECTION.NAME] > > [/foreach] > > > > SECTION has various elements such as > > > > NAME > > IMAGE > > LINK > > IS_SECTION > > etc... > > > > The IS_SECTION is of particular interest. The IS_SECTION contains a Y or an N, depend on whether or not it's a section or a category. > > > > Is it possible to do something like: > > > > [if [$SECTION.IS_SECTION] == "Y"] > > > > When I do that I get the following: > > > > Parse error: parse error in /var/www/virtuals/youreshop/dev/2002-smarty/hp/templates_c/50/5088fd25b0c0af 451d7b67edd1bcedde/d41d8cd98f00b204e9800998ecf8427e.php on line 34 > > > > Any ideas? > > > > Thanks, > > Brad Atkins > > Manager, Technical Development > > > > Sales: 1-877-973-2278 > > Support: 1-877-973-4968 > > Email: brad@youreshop.com > > > > > > > > -- > Monte Ohrt <monte@ispi.net> > Director of Technology, ispi Inc. > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.smarty.general (#3419) next »