[solved]If statement not functioning

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
brook
New Member
New Member
Posts: 4
Joined: Tue Mar 01, 2011 10:28 pm

[solved]If statement not functioning

Post by brook »

I am a newbie to CMSMS but not to programming. I don't understanding why my if statement isn't working. I put the following code into a Global Content Block:

take control of your {menu_text}{if menu_text=='Home'}H!{/if}<strong>digital shelf space.</strong>

But I get the following on the page:
take control of your Homedigital shelf space

Why isn't the H! text displaying?

Thanks in advance for the help
Last edited by brook on Thu Mar 03, 2011 5:42 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: If statement not functioning

Post by Dr.CSS »

The menu_text etc. is not a cmsms function, if on a page you need {title} and {$page_alias} if menu_text were to work it would need $ in it...
brook
New Member
New Member
Posts: 4
Joined: Tue Mar 01, 2011 10:28 pm

Re: [Solved] If statement not functioning

Post by brook »

Thanks for the guidance. The solution was to use alias:

{if $page_alias=="home"}H!{/if}
Post Reply

Return to “CMSMS Core”