Log in

View Full Version : if conditional OR


basketmen
10-08-2008, 09:36 AM
Hi guys i have this code

<if condition="$post['field11']">



i need the conditional to field 11 or field 13

what is the right code, i have try this but its wrong

<if condition="in_array($field, array(11,13))">



thank you guys :up:

orryun
10-08-2008, 09:51 AM
You could use this way:


<if condition="$post['field11'] OR $post['field13']">
//lines
</if>


This will show the "//lines" if field11 or field13 exists.

SEOvB
10-08-2008, 10:22 AM
<if condition="($post['field11']) OR ($post['field13'])">
code
</if>


Should also do the trick if the above gives any errors

basketmen
10-08-2008, 12:20 PM
thank you guys

valdet
10-08-2008, 01:13 PM
Very useful tips. Thanks.