tags:

views:

198

answers:

2

Hi, i would like to ask if there is an elseif statement in blogger? All i've seen is only if and else but no elseif.

If there isn't any elseif statement, how can i give multiple condition to an if statement?

For instance in this case, i have 3 author A B and C. Recently D and E have joined us, i have a code such that if the author is A B or C, it will post their respective images

<b:if cond='data:post.author == &quot;Author-A&quot;'>

<img class='ava' height='100'
src='img-URL-1'
width='100'/>

</b:if>
<b:if cond='data:post.author == &quot;Author-B&quot;'>

<img class='ava' height='100'
src='img-URL-2'
width='100'/>

</b:if>

and so on. But if the author is not A B or C, the CSS would screw up my blog post, so i thought of using elseif for this and if elseif is not available in this case, i thought of adding this after the above code

<b:if cond='data:post.author != &quot;Author-A&quot && &quot;Author-B&quot && &quot;Author-C&quot;'>

<img class='ava' height='100'
src='else-IMG-URL'
width='100'/>

</b:if>

But i've tried that and it doesn't seem to work it says && is invalid. Any idea what i should put in to use as OR ?

+1  A: 

Translated in pseudocode you logically rather want to do the following:

if (author != A && author != B && author != C)

and thus not what you tried:

if (author != A && B && C)
BalusC
A: 

Perhaps you need to specify && as &amp;&amp;?

That should resolve the error message you're getting. You will likely still have to fix the logic problem that BalusC pointed out.

Brad
Thanks, yes i forgot about that, i added what BalusC pointed out but still it seem that blogger doesn't allow '!=' as soon as i had this in, the blog post doesn't show up.
Crays
Brad