博主b:if声明 [英] blogger b:if statement

查看:59
本文介绍了博主b:if声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问博客中是否有elseif语句? 我所看到的只是在其他情况下,而在其他情况下.

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.

如果没有其他elseif语句,我该如何为if语句赋予多个条件?

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

例如,在这种情况下,我有3位作者A B和C.最近D和E加入了我们,我有一个代码,如果作者是A B或C,它将发布他们各自的图像

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>

,依此类推. 但是,如果作者不是A B或C,那么CSS会弄乱我的博客文章,所以我想到了为此使用elseif,如果在这种情况下elseif不可用,我想在上面的代码之后添加

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>

但是我已经尝试过了,但它似乎不起作用,它说&&是无效的.任何想法我应该把什么用作OR吗?

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 ?

推荐答案

以逻辑上的伪代码翻译,您宁愿执行以下操作:

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

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

,因此不是您尝试的操作:

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

这篇关于博主b:if声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆