if statement - Blogger: Implementing a simple IF with an OR in the condition -


in blogger template have following code:

<b:if cond='data:blog.pagetype == &quot;index&quot;'>     <!-- lot of lines of code --> </b:if>  <b:if cond='data:blog.pagetype == &quot;archive&quot;'>     <!-- same lines of code --> </b:if> 

it possible merge both 'if's in unique expresión?. using simple logical or?. i've tried following no result:

<b:if cond='data:blog.pagetype == &quot;index&quot; ||             data:blog.pagetype == &quot;index&quot;'>  <b:if cond='data:blog.pagetype == &quot;index&quot; &#124;&#124;             data:blog.pagetype == &quot;index&quot;'>  <b:if cond='data:blog.pagetype == &quot;index&quot; or             data:blog.pagetype == &quot;index&quot;'>  <b:if cond='data:blog.pagetype == &quot;index&quot; || &quot;index&quot;'>  <b:if cond='data:blog.pagetype == &quot;index&quot; &#124;&#124; &quot;index&quot;'> 

note: &#124; html expression '|'.

i google no result, , reviewed blogger b:if statement, found no answer simple question.

----- edited -----

the desired result having code like:

<b:if cond='data:blog.pagetype == &quot;index&quot;' ||        cond='data:blog.pagetype == &quot;archive&quot;'>     <!-- lot of lines of code --> </b:if> 

in way, don't repeat block 'lot of lines of code', resulting more maintainable code, , simplier.

anyway, knowing how simple or thing furure cases.

to simulate or operator in blogger template, use in operator.

in case:

<b:if cond='data:blog.pagetype in {&quot;index&quot;,&quot;archive&quot;}'>     <!-- block run when pagetype index or archive--> </b:if> 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -