---
title: "forblock"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/sline/object/forblock'
  md: 'https://developer.shopline.com/docs/sline/object/forblock.md'
---

# forblock


    Information about the parent `blocks` loop.
This object is available only within the [blocks](https://developer.shopline.com/docs/sline/tag/blocks.md)  tag.

    



## Properties

    <div>
    

        
<ObjectProperty 
    name="id"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The ID of the current block.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="index0"
    types={[<Mdx>integer</Mdx>]}
>
<ObjectSummary>
The index of the current iteration, starting from `0`.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="index"
    types={[<Mdx>integer</Mdx>]}
>
<ObjectSummary>
The index of the current iteration, starting from `1`.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="type"
    types={[<Mdx>string</Mdx>]}
>
<ObjectSummary>
The type of the current block.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="blocks_size"
    types={[<Mdx>integer</Mdx>]}
>
<ObjectSummary>
The total number of blocks in the loop.


</ObjectSummary>
</ObjectProperty>
        
<ObjectProperty 
    name="settings"
    types={[<Mdx>any</Mdx>]}
>
<ObjectSummary>
The settings of the current block.


</ObjectSummary>
</ObjectProperty>
        
    
    </div>



    
## Example

        
            

            Add an outer `div` wrapper when the block type is `title`.


            
```sline
{{#blocks}}
    {{#if forblock.type == "title"}}
        <div class="title-wrapper">
            {{#block wrapped=true /}}
        </div>
    {{#else /}}
        {{#block /}}
    {{/if}}
{{/blocks}}
```
            

            
        
    
