b:loop Tag - Blogger Tags References

b:loop Tag - Blogger Tags References
Loops allow access to the data contained in a table. In Blogger's XML editor , a loop is implemented using the tag <b:loop>. It provides access to the items of ARRAY.

Loop Syntax:

<b:loop values='ARRAY' var='VARIABLE_NAME'>
  <!-- Code to Be Executed Here -->
</b:loop>

Attributes used for b:loop tag

AttributesClassificationPrefix "expr:"DescriptionStrictness
valuesXML Blogger ExpressionauthorizedTable arrayto extract in the loop.
The expected value can be an explicit value, a data item or a Blogger expression whose type is array
To create an expression, use:
Mandatory
varHTML classicauthorizedThe expected value is any variable name that will contain the values of the items in the array.
As an indication, in the gadget model supplied by default, Blogger engineering has chosen for most tables, the name of the table in the singular (without "s"). For example, the variable used for the array data:posts is post.
Mandatory
indexHTML classicauthorizedThe expected value is a character string.
This attribute provides the index number in the loop.
Optional
reverseHTML classicauthorizedThis attribute reverses the direction of the loop.
The expected value must be boolean(boolean). Either true (true) or false (false).
When this attribute is not mentioned the default value is false (false).
The value can also be a Blogger expression, the result of which returns a Boolean value.
Note: The attribute does not affect the numbering of the index.
Optional

Get Items from an Array:

General Example:

<b:loop index='i' expr:reverse='data:view.isArchive' values='data:videos' var='video' >

  <!-- INDEX -->
  <data:i/>

  <!-- ITEM -->
  <data:video.itemName/>

</b:loop>

An Object Array - Example:

<b:loop values='data:posts' var='post' >

  <!-- ITEM -->
  <data:post.title/>

</b:loop>

A singleton Array - Example:

<b:loop values='["Mickey","Donald","Dingo"]' var='character' >

  <!-- ITEM -->
  <data:character/>

</b:loop>

Conclusion:

That's all about b:loop tag in Blogger Tags References.

21 Comments

Was this article useful? Please Leave Your Feedback by writing what's in your mind, below.
  1. how can i add a Floating Author Profile Revealer on blogger

    ReplyDelete
    Replies
    1. Please wait for a while i will write article about it.

      Delete
  2. how can i hide sidebar from page????

    ReplyDelete
  3. bro plz write a post about how to hide sidebar on page in blogger plz...

    ReplyDelete
  4. How Can I Hide Sidebar From Page????

    PLZ REPLY PLZ PLZ PLZ PLZ

    ReplyDelete
    Replies
    1. Contact me privately dear on whatsapp.

      Delete
  5. Sir can u please help me
    When i installed template everything was fine but i started modifying it for various issues my site follow us option got completely destroyed and started looking ugly can u please help me out.
    Mysite

    ReplyDelete
    Replies
    1. Free version of all premium templates contains JavaScript code that does not allow editing of the theme. If you edit the theme, all the settings will be completely destroyed and theme styles also. You should buy the premium version to make changes into the theme.

      Delete
  6. Share a tutorial about the copy to clipboard system using on this blog.

    ReplyDelete
    Replies
    1. OK dear Limon i will write article about it as soon as possible.

      Delete
    2. Is vlog ki jeysha kyasa banai?

      Delete
  7. كيف ازود مشاهدات علي بلوجر

    ReplyDelete
    Replies
    1. استمر في مشاركة محتوى فريد بعد مرور بعض الوقت في ترتيب مدونتك. سأكتب مقالاً عنه قريباً.

      Delete
  8. bro plz write a article about how to i add media.net ads on between post

    ReplyDelete
  9. Can we limit the the no. of loops?

    ReplyDelete
    Replies
    1. If you are talking about the number of iterations of the loop, yes you can limit the number of iterations.

      Delete
    2. I will be explaining after some time because at this time I am not free that why I am not even publishing new articles. Please wait.

      Delete

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}