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>
<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>
<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 home link with the blog's homepage url.
A link with the blog's post RSS feed url. The ‘+' operator concatenates the two strings.
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.