Page 1 of 1

[Solved] Smarty if statement is not parsed in 1.11

Posted: Sun Sep 23, 2012 12:00 am
by paulbaker
This may be due to lack of sleep, but.... :'(

In a 1.10 site template I have

Code: Select all

{ if $content_id == 18 }BLAH{ /if }
and BLAH shows only for the page with id 18. Niiiice.

But, in 1.11 I use the same code and the whole { if $content_id == 18 }BLAH{ /if } shows up in the live page - the smarty is not parsed.

But in 1.11 other smarty like {title} is parsed OK.

Help?

Thank you ;D

Re: Smarty if statement is not parsed in 1.11

Posted: Sun Sep 23, 2012 12:16 am
by Jo Morg
Not sure if it applies but Smarty 3 parses { $foo } as being {*$foo*}. So you may have to remove the spaces separating the delimiters and the tag contents and parameters {$foo}.

HTH

Re: Smarty if statement is not parsed in 1.11

Posted: Sun Sep 23, 2012 12:28 am
by Dr.CSS
You might try '18' besides closing the spaces...

Re: Smarty if statement is not parsed in 1.11

Posted: Sun Sep 23, 2012 12:51 am
by paulbaker
Thank you for the replies Jo Morg and Dr.CSS.

Removing spaces was the answer.

So:

Code: Select all

{ if $content_id == 18 }BLAH{ /if }
does not work.

But:

Code: Select all

{if $content_id == 18}BLAH{/if}
is correctly parsed. ::)

Thanks again!