b:widget Tag - Blogger Tags Reference

b:widget Tag - Blogger Tags  References
The <b:widget> in blogger tag reference is the second tag which is used as a layout element in the blogger XML editor.
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.
AttributeDescriptionStrictness
idId 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
classClass name for this tag.Optional
titleThe 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
typeThis attribute defines Type of Widget.Mandatory
mobileDisplay of the gadget in the personalized mobile version.
  • yes: Yes, the gadget will be displayed in the mobile version and the web version.

  • no: No, the gadget will only be displayed in the web version. only: The gadget will only be displayed in the mobile version

  • CAUTION! This attribute is only active with version 1 gadgets .
    Optional
    lockedUsed 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
    condThis attribute is used for the execution of any condition or expression for the section.Optional
    visibleThis 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
    versionVersion 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.
    b:widget Tag - Blogger Tags  References

    Winding Up:

    This was all about blogger widget Tag, second main tag in Blogger Tag References.

    Post a Comment

    Was this article useful? Please Leave Your Feedback by writing what's in your mind, below.

    Recent Comments

    {getWidget} $results={3} $label={comments} $type={list}