Skip to main content

block

The content and settings of a section block.

Sections and blocks are reusable modules of content that make up templates.

You can include a maxiumum of 50 blocks in a section. To learn more about using blocks, refer to the Building with sections and blocks.

Properties

The ID of the block.

The ID is dynamically generated by Shopify and is subject to change. You should avoid relying on a literal value of this ID.

Anchor to
settings

The settings of the block.

To learn about how to access settings, refer to Access settings. To learn which input settings can be applied to the type property within settings, refer to Input settings.

Anchor to
shopify_attributes

The data attributes for the block for use in the theme editor.

The theme editor's JavaScript API uses the data attributes to identify blocks and listen for events. No value for block.shopify_attributes is returned outside the theme editor.

The type of the block.

The type is a free-form string that's defined in the block's schema. You can use the type as an identifier. For example, you might display different markup based on the block type.

{
"id": "column1",
"settings": "array",
"shopify_attributes": "data-shopify-editor-block=\"{\"id\":\"column1\",\"type\":\"column\"}\"",
"type": "column"
}
Was this section helpful?