[Solved] Smarty if statement is not parsed in 1.11

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

[Solved] Smarty if statement is not parsed in 1.11

Post 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
Last edited by paulbaker on Sun Sep 23, 2012 12:51 am, edited 1 time in total.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Smarty if statement is not parsed in 1.11

Post 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
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Smarty if statement is not parsed in 1.11

Post by Dr.CSS »

You might try '18' besides closing the spaces...
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Re: Smarty if statement is not parsed in 1.11

Post 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!
Post Reply

Return to “CMSMS Core”