📜 ⬆️ ⬇️

New Blogger Operators

According to Blogger Buzz , Blogger has added support for several new operators to the Blogger blogging engine, with which you can fine-tune the appearance of individual pages when writing your own template.


If earlier only operations of addition and comparison with multilevel if ... else conditions were available, then the following expressions are now available.

  1. Changing the order of operations with parentheses.

    <div expr:style='"max-width: " + (data:width + 10) + "px;"'>...</div> 

  2. Inversion of conditions with ! or not .
    ')
     <b:if cond='!data:post.allowComments'>...</b:if> 

  3. Choosing two values ​​with ? .

     <a expr:class='data:post.allowComments ? "comments" : "no-comments"'>...</a> 

  4. Specifying multiple conditions with || or or .

     <b:if cond='data:imagePlacement == "BEFORE_DESCRIPTION" or data:imagePlacement == "REPLACE"'> <b:include name="image" /> </b:if> 

  5. Accessory operators in and contains .

     <b:if cond='data:blog.pageType in {"index", "archive"}'>...</b:if> 

  6. Combining conditions with && or and .

     <b:if cond='data:blog.pageType not in {"item","static_page"} and data:post.allowComments'> <b:include name='comment_count_picker' data='post' /> </b:if> 

A detailed description of all expressions and examples of their use are in the help .

Source: https://habr.com/ru/post/258653/


All Articles