<b:widget> Syntax and Attribute
Blogger XML Language
<b:widget id='STRING' cond='EXPRESSION' locked='BOOLEAN' version='NUMBER' title='STRING' type='WIDGET_TYPE' mobile='BOOLEAN' visible='BOOLEAN'> </b:widget>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 also added, it contains the value widget and the type of the widget. The attribute data-version is also added replacing the version of widget.
<b:widget> Example
The Basic
<b:widget id='HTML101' locked='false' title='Foo' type='HTML' version='2' visible='true'> <b:includable id='main'> <h1> <data:title/> </h1> <div> Hello Word </div> </b:includable> </b:widget>
Hide Widget in Mobile View
In layout version 1, if we activated mobile view in Theme option, the widget will not be displayed by default. Because statement mobile="no" is hidden in there by default. To make widget appear on mobile view, we must declare mobile="yes" in the widget.On newer Layout Version, since is not supporting attribute mobile, we must give an expression condition to the widget. The expression is data:blog.isMobileRequest with the operator ! (not)
Example Code
<b:widget cond='!data:blog.isMobileRequest' id='HTML101' locked='false' title='Foo' type='HTML' version='2' visible='true'>
Other Tag
- <b:attr>
- <b:case>
- <b:class>
- <b:comment>
- <b:default>
- <b:defaultmarkup>
- <b:defaultmarkups>
- <b:eval>
- <b:else>
- <b:elseif>
- <b:if>
- <b:include>
- <b:includable>
- <b:loop>
- <b:message>
- <b:param>
- <b:section>
- <b:skin>
- <b:switch>
- <b:tag>
- <b:template-script>
- <b:template-skin>
- <b:widget>
- <b:widget-setting>
- <b:widget-settings>
- <b:with>
- <![CDATA[]]>
- <data:.../>