Close

×

Tutorials

Blogger Tutorial

Start Blogger

Templates

Blogger Templates

Recent Post Popular Post Featured Post Related Post

nayan ad

Share


Like
×

Top Navigation Menu

×

Search v5Blogger

Powered by Google

Blogger <b:loop> Tag

The b:loop tag lets you repeat a section of content multiple times.
  • Repeat code multiple times.
  • It saves a lot of work.

HTML b:loop Syntax

Each Blogger Loop in your template has opening and closing tags.

<b:loop var='identifier' values='set-of-data'>
  Repeated Content Here
</b:loop>
var can be any name.
values can be any HTML Data.

Usage of b:loop Tag

Go to Template > Edit HTML.

Blogger Section: new

<html>
<head>
<title><data:blog.pageTitle/></title>
<b:skin/>
</head>

<body>
<b:section id='new'/>

<b:loop var='i' values='1 to 3'>
  <li><data:i /></li>
</b:loop>

</body>
</html>
  • 1
  • 2
  • 3
  • A loop tag allows you to iterate across an inclusive number range, such as ‘1 to 3', ‘-3 to -9', where the value of the variable takes the number's value.

    Control b:loop Tag

    Control Blogger Loop with attributes.

    <ul>
      <b:loop var='number' index='index' values='9 to 7'>
        <li>Index: <data:index />, Number: <data:number /></li>
      </b:loop>
    </ul>

    This Blogger Loop tags also have an optional index attribute, which gives the zero-based index of the current iteration through the loop.

    HTML b:loop Attributes

    Attribute Values Description
    var name Defines a name for the loop
    values name Defines HTML Data for the loop.
    index value Defines zero-based index of the current iteration through the loop.

    Footer Note

    v5 Blogger is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2016. All Rights Reserved.
    Powered by W3.CSS.

    v5 Library