- Get link
- X
- Other Apps
b:attr
The b:attr tag, or the attribute tag, is a tag for simplifying adding an attribute to the parent element, especially conditionally.
Attributes
name - Name of the attribute.
value - Value of the attribute.
cond - Boolean expression for whether to append the attribute
Example usage
<div>
<b:attr name='data-foo'
value='data:blog.blogId'
cond='data:view.isHomepage' />
</div>
On homepages, this would produce
<div data-foo='123456789012'>
</div>
On other pages, this would produce
<div>
</div>