This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Switch / case - multiple check
expandshrink

Switch / case - multiple check

Switch / case - multiple check

Friday 30 April 2004 11:01:23 am - 3 replies

Is it possible to shrink this code:

{case match=343} 
{/case}
{case match=136} 
{/case}
{case match=141} 
{/case}
{case match=142} 
{/case}
{case match=192} 
{/case}
{case match=193} 
{/case}
{case match=194} 
{/case}
{case match=195} 
{/case}

into something like:

{case match=343,136,141,142,192,193,194,195} 
{/case}

The last example doesn't work, but something in this style keeps it much cleaner...

Regards Bjørn

Friday 30 April 2004 11:10:48 am

Sure:

{section show=array( 343,136,141,142,192,193,194,195 )|contains( $node.node_id )}
 
{/section}

paul

--
http://www.visionwt.com

Friday 30 April 2004 11:17:36 am

or you can do it like this:

{case in=array( 343,136,141,142,192,193,194,195 )}
{/case}

Friday 30 April 2004 11:25:58 am

Thanks!

Works like a charm.

Regards Bjørn

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from