The expression evaluation tag <b:eval> is a tag for evaluating the value of an expression. <b:eval> tags can combine or modify data values using an expression then print its value.

<b:eval> Syntax and Attribute

Blogger XML Language
<b:eval expr='EXPRESSION'/>
The evaluation tag has only one attribute, which is expr:

<b:eval> Example

A Concatenate Operation
<button class='subscribe-button pill-button'>
    <b:eval expr='data:messages.subscribe + " to " + data:blog.title'/>
</button>
Result will be "Subscribe to BlogTitle"
A Ternary Operation
<b:eval expr='data:view.isHomepage ? data:blog.pageName : data:blog.pageTitle'/>
The result of the expression is one of two defined values.
  • If Homepage: "data:blog.pageName
  • Else: data:blog.pageTitle
Creating Post Summary
<b:eval expr='data:post.body snippet {length: 250, links: false, linebreaks: false}'/>


Other Tag

Share This

About
BloggerBasics101 is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License.
Misc
Course