Blocks
A block
represents the content and settings of a single block in an array of section blocks. The block
object can be accessed in a section file by looping through settings``.blocks
. Each block has below listed fields
block.name#
Returns the name of the block
#
block.typeReturns the type of the block. One section can have multiple type of blocks. - Types of Input
#
block.propsReturn the props of the block. These props are similar to the those that are present under settings. More info about block props
#
Block PropsBlock props are used to configure the look and feel of sections blocks. Use settings.blocks[0].props
to access the first block inside section template
Each prop is an object with various fields explained below
#
block.props.[prop_id].valueReturns the value of the prop id.
#
block.props.[prop_id].defaultReturns the default value of the prop
#
block.props.[prop_id].typeReturns the type of the prop. This type is used in the Theme editor to show various input types. Available input types are - text, color, range, checkbox, product, brand, collection, html, image & video
#
block.props.[prop_id].labelReturns the label for the prop
#
block.props.[prop_id].infoReturns info of the prop. This info is used in the tooltip of the Theme editor
#
Example{ "type": "product", "name": "Product", "props": [ { "type": "product", "id": "product", "label": "Select a Product", "info": "Product Item to be displayed" } ]}