Latest news, food, business, travel, sport, Tips and Tricks...

Blogger b:defaultmarkups and b:defaultmarkup Tag

Markup tags <b:defaultmarkups> is <b:defaultmarkup> nesting place, and if we nest <b:includable> inside this tag, we can create default theme layout to the template.

The Syntax and Attribute

BLOGGER XML LANGUAGE

<b:defaultmarkups>

    <b:defaultmarkup type='WIDGET_TYPE'>

 

    </b:defaultmarkup>

</b:defaultmarkups>

  • The tag <b:defaultmarkups> can only contain tags <b:defaultmarkup>.
  • Multiple <b:defaultmarkup> can be nested with different type.
  • The tag <b:defaultmarkup> can only contain tags <b:includable>.
  • The block <b:defaultmarkups> should preferably be located before </head> or </body>.

Implementation and Example

This tag set can be placed anywhere except in the <b:skin> and <b:template-skin>. Example placing right before </head> or </body> or </html>. Placing it right before </body> seems like a good idea, its make it easier to find and manage it.

When the widget / gadgets are installed or reset, the inclusions that are nested inside <b:defaultmarkup> will be automatically added inside the body of the widget, and, if the id of inclusion match with the current widget, it will be overridden by this markup.

EXAMPLE: SINGLE WIDGET TEMPLATE MARKING

<b:defaultmarkups>

    <b:defaultmarkup type='Blog'>

        <b:includable id='main'>

            <!-- Main code Block -->

        </b:includable>

    </b:defaultmarkup>

</b:defaultmarkups>

EXAMPLE: MARKING MULTIPLE GADGETS AND INCLUSION

<b:defaultmarkups>

    <b:defaultmarkup type='Blog,FeaturedPost,PopularPosts'>

        <b:includable id='postJumpLink'>

            <!-- postJumpLink code Block -->

        </b:includable>

        <b:includable id='postFooterJumpLink'>

            <!-- postFooterJumpLink code Block -->

        </b:includable>

    </b:defaultmarkup>

</b:defaultmarkups>

We can also create an inclusions that can be called anywhere in the theme. by giving the type value 'Common' in a tag <b:defaultmarkup> and calling with singleton tag <b:include name='ID'/> instead of a type of markup.

EXAMPLE: COMMON INCLUSIONS IN A GADGET

<b:defaultmarkups>

  <b:defaultmarkup type='Common'>

    <b:includable id='MyMetaTags'>

      <!-- "MyMetaTags" inclusion code block -->

    </b:includable>

  </b:defaultmarkup>

</b:defaultmarkups>

EXAMPLE: CALLING COMMON INCLUSION

<b:widget>

    <b:include name='MyMetaTags'/>

</b:widget>

In above example we creating an inclusion with id 'MyMetaTags', because its nested in <b:defaultmarkup> tag with type 'Common', so, we can call it anywhere with <b:include> tag with name value is id from <b:includable> tag.

,
//