Site is Under Maintenance
Please come back again in...
00 Days
00 Hours
00 Minutes
00 Seconds
Wellcome To My Blog Dulpan Adi Saragih. Thanks For Visiting My Blog New! Join Disscusion Now!

b:include

The <b:include> is statement takes all the text/code/markup that exists in the <b:includable> tags and copies it into the part that calling the include statement.

Blogger Inclusion tag Syntax and Attribute

<B:INCLUDE/>

<b:include cond='EXPRESSION'
           data='DATA-ALIAS'
           name='STRING1'/>

<B:INCLUDABLE>

<b:includable id='STRING1'
              var='STRING'>
   <!-- span Block -->
</b:includable>
  • The tags <b:includable> can only nest in a tag <b:widget> or <b:defaultmarkup>.
  • Tags <b:include/> is statement to calling or to include or to take <b:includable> together, and its singleton.
  • 'DATA-ALIAS' is dataset forwarded to be processed inside tag <b:includable>.
  • Attribute name in <b:include> tag, is a statement that he calls <b:includable> to include content together which id same as name.
  • var in <b:includable> tag its data: name to be used by child <data:.../> as children.

<b:include/> and <b:includable> Example

THE INCLUDABLE

<b:includable id='list'>
        <b:loop values='data:foo' var='item'>
        <li>
            <data:item/>
        </li>
        </b:loop>
</b:includable>

CALLING INCLUDABLE 'LIST' WITH DATA-ALIAS

<ol>
<b:include data='{ foo: ["Qux","Quux"] }' name='list'/>
<b:include data='{ foo: ["Corge","Graul"] }' name='list'/>
<b:include data='{ foo: ["Garply","Waldo"] }' name='list'/>
</ol>

RESULT

    1. Qux
    2. Quux
    3. Corge
    4. Graul
    5. Garply
    6. Waldo

With data-alias we can process multiple data with same format and get same result to avoid repeating typing same code again. The data with foo will be forwarded to <b:includable> tag and processed in <b:loop> tag with variable name item transform into <data:item/>.

THE INCLUDABLE WITH CHILD

<b:includable id='list' var='parent'>
    <b:include data='parent' name='list2'/>
</b:includable>
<b:includable id='list2'>
<b:if cond='data:foo'>
        <b:loop values='data:foo' var='item'>
        <li>
            <data:item/>
        </li>
        </b:loop>
<b:elseif cond='data:bar'/>
        <ol>
        <b:loop values='data:bar' var='item'>
            <li><data:item/></li>
        </b:loop>
        </ol>
</b:if>
</b:includable>

CALLING INCLUDABLE 'LIST' WITH DIFFERENT DATA NAME

<ol>
<b:include data='{ foo: ["Qux","Quux"] }' name='list'/>
<b:include data='{ bar: ["Corge","Graul"] }' name='list'/>
<b:include data='{ foo: ["Garply","Waldo"] }' name='list'/>
</ol>

RESULT

    1. Qux
    2. Quux
        1. Corge
        2. Graul
    3. Garply
    4. Waldo

In this example, data with different name and various string forwarded to <b:includable> with a name 'list' and variable 'parent', transform into group data:parent and gave to next <b:includable> with the name 'list2'. Conditional Statement is there to test which group and process with matching statement.

Server Managed Inclusion

Blogger has default inclusion that we can call to be used in our template. This are inclusions that are stored on the Blogger serverside. Mostly marked with prefix super in the inclusion. Other are The Common Inclusion, this inclusion can be installed anywhere except b:skin. The known inclusion present inside default tempate are:

<b:include name='all-head-content'/>
<b:include name='postMetadataJSON'/>

Other Tag

Rate this article

Getting Info...

About Post Author

Cookies Consent

This website uses cookies to ensure you get the best experience on our website.

Cookies Policy

We employ the use of cookies. By accessing Plus UI, you agreed to use cookies in agreement with the Plus UI's Privacy Policy.

Most interactive websites use cookies to let us retrieve the user’s details for each visit. Cookies are used by our website to enable the functionality of certain areas to make it easier for people visiting our website. Some of our affiliate/advertising partners may also use cookies.