b:widget Tag - Blogger Tags Reference

This tag is used to define widgets in blogger you can also say that this is the container tag for a blogger widget code.
Syntax of <b:widget> Tag:
<b:widget cond='true' id='Header1' locked='false' title='Blogger Code (Header)' type='Header'>
/*
Main Widget Code
*/
</b:widget>Characteristics of <b:widget> Tag:
- It can only be used with in <b:section> Tag.
- Each <b:widget> Tag can only contain one includible section, one of which is mandatory with identifier main.
- It cannot be nasted.
Attributes Used for <b:widget> Tag:
This is a list of some several attributes that can be added in this tag some are required and some are optional.| Attribute | Description | Strictness |
|---|---|---|
| id | Id is the unique identifier for this tag. The identifier is composed of the type of gadget, followed by a number between 1 and 999. | Mandatory |
| class | Class name for this tag. | Optional |
| title | The title of the gadget. Generally, this is the title defined in the gadget's control panel. The attribute is mandatory, but the value can remain empty. | Mandatory |
| type | This attribute defines Type of Widget. | Mandatory |
| mobile | Display of the gadget in the personalized mobile version.CAUTION! This attribute is only active with version 1 gadgets . | Optional |
| locked | Used for Locking the gadget. When the gadget is locked, the user can no longer delete it or move it around in the layout. The attribute also accepts values yes | no that become respectively true | false. | Optional |
| cond | This attribute is used for the execution of any condition or expression for the section. | Optional |
| visible | This attribute is used to set the widgets visibility. Specified values are true and false. Only used for layout version 3 and widget version 2 widgets. | Optional |
| version | Version number of the gadget. Value 1 or 2. The value is set automatically when the gadget is integrated and depends essentially on the version of the Layouts. | Optional |
HTML rendering:
In the HTML rendering of the blog, the tags <b:widget> are replaced by tags <div>.The tag <div> will contain the attribute id.
The attribute class is automatically added. It contains the value widget and type of widget.
And finally, the attribute data-version mentions the version of the gadget.
<b:widget id='Header1' locked='false' title='Blogger Code (Header)' type='Header' version='2'>
</b:widget>The above XML code will be rendered into HTML and will look like this. <div class='widget Header' id='Header1' data-version='2'>
</div>Preview Of b:widget Tag in Layout Section:
The preview of this tag in the layout section of blogger looks like this.
Comments
Post a Comment