Close

×

Tutorials

Blogger Tutorial

Start Blogger

Templates

Blogger Templates

Recent Post Popular Post Featured Post Related Post

nayan ad

Share


Like
×

Top Navigation Menu

×

Search v5Blogger

Powered by Google

Blogger <b:expr> Attribute

Use expr attribute to insert values.
  • Set attribute values.
  • Use data dictionary values.
  • Expr is basically used in conjuction with data tags.

HTML expr Syntax

Blogger expr can set a attribute value.

<a expr:href='data:blog.homepageUrl'>Home</a>
<img expr:src='data:post.thumbnailUrl'/>
<div expr:class='data:post.oldLinkClass'>Old Link</div>
Use expr with attribute.

Usage of expr Attribute

Go to Template > Edit HTML.

Blogger Section: new

<html>
<head>
<title><data:blog.pageTitle/></title>
<b:skin/>
</head>

<body>
<a expr:href='data:post.url'>Current Page URL</a>

<b:section id='new'>
  <b:widget id='Blog1' type='Blog'/>
</b:section>

</body>
</html>
This example shows how to output current page URL.

HTML expr Examples

  • <a expr:href='data:blog.homepageUrl'>Home</a>
    A home link with the blog's homepage url.

  • <a expr:href='data:blog.homepageUrl + "feeds/posts/default"'>Posts RSS</a>
    A link with the blog's post RSS feed url. The ‘+' operator concatenates the two strings.

  • <a expr:class='data:post.allowComments ? "comment" : "no-comment">Comment</a>
    A link with the class "comment" when comments are allowed, and "no-comment" when they are not. The ternary operator (?:) takes the given boolean value and picks the first value (after the ?) if the boolean is true, or the second value (after the :) if the boolean is false.
  • Footer Note

    v5 Blogger is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2016. All Rights Reserved.
    Powered by W3.CSS.

    v5 Library