Latest news, food, business, travel, sport, Tips and Tricks...

Blogger b:eval Tag

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

 

,
//