block
The content and settings of a block.
Blocks are reusable content modules that make up a template. The block object is accessible only within HTML files located in the blocks directory.
Properties
The block ID, dynamically generated by SHOPLINE.
The settings of the block.
The data attributes used for interaction between the block and the theme editor.
The attributes are used in the theme editor's JavaScript API requests for block identification and event listening. When accessed outside the theme editor, block.shopline_attributes returns nil.
The type of the block.
The value is determined by the block file path and block filename. For global blocks, for example, if the file path is blocks/block.html, the type value is block. For private blocks, for example, if the file path is sections/blog-demo/blocks/block.html, the type value is $block.
The 0-based index of the current block.
The 1-based index of the current block.
The number of child blocks contained within the block.