Multiple values in IF-statement?

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
johnnylocktang
New Member
New Member
Posts: 6
Joined: Wed Jul 03, 2013 7:15 pm

Multiple values in IF-statement?

Post by johnnylocktang »

Hi,

Quick question (again).

Is it possible to set multiple values in this statement?
For example, IF $page_alias eq "hem" and "home" and "home2".
{if $page_alias eq "hem"}

Thanks
uniqu3

Re: Multiple values in IF-statement?

Post by uniqu3 »

Code: Select all

{if ($page_alias == 'home') || ($page_alias == 'home2') || ($page_alias == 'home3')}

Code: Select all

{if ($page_alias == 'home') or ($page_alias == 'home2') or ($page_alias == 'home3')}
johnnylocktang
New Member
New Member
Posts: 6
Joined: Wed Jul 03, 2013 7:15 pm

Re: Multiple values in IF-statement?

Post by johnnylocktang »

Hmm, not really working mate.

Code: Select all

{if ($page_alias neq 'hem') or ($page_alias neq 'boka')}
If I remove 'boka' its works fine.
johnnylocktang
New Member
New Member
Posts: 6
Joined: Wed Jul 03, 2013 7:15 pm

Re: Multiple values in IF-statement?

Post by johnnylocktang »

Is it because I use neq (not equal)?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: Multiple values in IF-statement?

Post by Jo Morg »

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

Return to “CMSMS Core”