Skip to main content

Blogger: How to Implement OR Operation Within b:if Block

We can do logical OR operation using or (keyword) or || (double pipes) in the condition for cond attribute of the b tag, specifically the b:if.

For example, we want to show custom content or executing script only on static page OR item (post):

OR:

We can put more than two conditions for the OR.

OR:

OR, WE MIX THEM πŸ˜‚

That actually works! But it will confuse ourselves. Thus, it is recommended to consistently use either one, the || (double pipes) or the or keyword.


Logical AND

AND OR

In latest Blogger XML, we can actually use the keyword and for AND operation. This is a post about that.

For more reference regarding b:if, b:elseif, and b:else, this is a post about Blogger Conditional Tag — b:if and b:else.

Last modified on

Comments

Monkey Raptor uses cookies or biscuits πŸͺ for analytics, functionality, and advertisements. More info in Privacy Policy