Share » Forums » Setup & design » If statement with or?

If statement with or?

If statement with or?

Thursday 18 March 2010 8:34:40 am - 4 replies

Author Message

Nicolas Pastorino

Thursday 18 March 2010 8:43:12 am

HI Ben,

This would be something like this :

{if or( eq( $myString, 'string' ), eq( $myString, 'different string' ) )}
  {* do stuff here *}
{/if}

More on the operator there : http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/logical_operations/or

Cheers !

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Ben Overmyer

Thursday 18 March 2010 8:48:05 am

Ah, I see.

What if I want to match only a part of the variable? For example:

if ($myvar.contains('string')) { doStuff; }

Nicolas Pastorino

Thursday 18 March 2010 9:09:57 am

Hei Ben,

What you are looking for is this :
http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/strings/contains

Happy string parsing,
Cheers,

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Ben Overmyer

Thursday 18 March 2010 9:12:36 am

Exactly what I was looking for, thanks much!!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu