---
title: 'Liquid objects: section'
description: The properties and settings of a section.
api_name: liquid
source_url:
html: 'https://shopify.dev/docs/api/liquid/objects/section'
md: 'https://shopify.dev/docs/api/liquid/objects/section.md'
---
# section
The properties and settings of a section.
***
**Tip:** To learn about sections and using them in a theme, refer to \Sections\.
***
## Properties
* * **blocks**
array of [block](https://shopify.dev/docs/api/liquid/objects/block)
* The blocks of the section.
* **id**
[string](https://shopify.dev/docs/api/liquid/basics#string)
* The ID of the section.
The ID for sections included through [JSON templates](https://shopify.dev/themes/architecture/templates/json-templates) are dynamically generated by Shopify.
The ID for static sections is the section file name without the `.liquid` extension. For example, a `header.liquid` section has an ID of `header`.
* **index**
[number](https://shopify.dev/docs/api/liquid/basics#number)
* The 1-based index of the current section within its location.
Use this property to adjust section behavior based on its position within its location ([template](https://shopify.dev/docs/themes/architecture/templates), [section group](https://shopify.dev/docs/themes/architecture/section-groups)) and on the page. The `index` starts at 1 within each location.
An example use case is for programmatically setting `loading="lazy"` for images below the fold based on an index higher than, for example, 3. Note that this is now the default behavior for the [`image_tag` filter](https://shopify.dev/docs/api/liquid/filters#image_tag).
Only use this for non-display use cases like web performance. Because of various limitations, the `index` property returns `nil` in the following contexts:
* When rendered as a [static section](https://shopify.dev/docs/themes/architecture/sections#statically-render-a-section)
* While rendering in the online store editor
* When using the [Section Rendering API](https://shopify.dev/docs/api/section-rendering)
* **index0**
[number](https://shopify.dev/docs/api/liquid/basics#number)
* The 0-based index of the current section within its location.
This is the same as the `index` property except that the index starts at 0 instead of 1.
* **location**
[string](https://shopify.dev/docs/api/liquid/basics#string)
* The scope or context of the section (template, section group, or global).
Sections can have one of four different location types. For sections rendered within a [template](https://shopify.dev/docs/themes/architecture/templates), the location will be `template`. For sections rendered within a [section group](https://shopify.dev/docs/themes/architecture/section-groups), the location will be the section group type, e.g., `header`, `footer`, `custom.`. Sections [rendered statically](https://shopify.dev/docs/themes/architecture/sections#statically-render-a-section) will be `static`. Finally, if you're still using `content_for_index`, then the value will be `content_for_index`.
* **settings**
* The [settings](https://shopify.dev/themes/architecture/sections/section-schema#settings) of the section.
To learn about how to access settings, refer to [Access settings](https://shopify.dev/themes/architecture/settings#access-settings).
##### Example
```json
{
"blocks": [],
"id": "template--14453298921537__cart-items",
"settings": {}
}
```