博主b :if statement

标签 blogger

请问blogger中有elseif语句吗? 我所看到的只是 if 和 else,但没有 elseif。

如果没有任何 elseif 语句,如何为 if 语句赋予多个条件?

例如,在本例中,我有 3 个作者 A B 和 C。最近 D 和 E 加入了我们,我有一个代码,如果作者是 A B 或 C,它将发布他们各自的图像

<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 在这种情况下不可用,我想在上面的代码后面添加这个

<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 吗?

最佳答案

用伪代码翻译,您在逻辑上更愿意执行以下操作:

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

因此不是您尝试过的:

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

关于博主b :if statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2032211/

相关文章:

html - 使用 bootstrap 构建博客模板

html - 在 Blogger 中使用相对链接

blogs - 我的 <div> 在 "min-width"和 "max-width"之间选择了最大宽度

javascript - 单击加载 Google plus javascript 以显示评论

javascript - 如何仅在 Blogger 的搜索页面中显示文本?

jquery - 高度 : 100% won't keep ratio of image

javascript - 我可以在 javascript 中使用博主条件标签(IF)吗

c# - 如何快速创建此类子域,例如 Blogger.com

python - 使用 gdata python 客户端在博客上批量发布

javascript - 删除 Blogger JS 小部件上评论号的显示