ValidLocalBlocks
Ensures that local blocks are being used correctly. This check enforces rules to maintain consistency and prevent errors in theme structure.
Anchor to Validation on local blocksValidation on local blocks
This section covers validations for local blocks in sections and in theme blocks.
Anchor to ✗ Fail✗ Fail
In this example, local blocks are being defined within theme blocks:
blocks/local-block.liquid
{% schema %}
{
"name": "Block name",
"blocks": [
{
"type": "local_block",
"name": "Local Block"
}
]
}
{% endschema %}
In this example, theme blocks are being used along with local blocks:
sections/local-block.liquid
{% schema %}
{
"name": "Section name",
"blocks": [
{
"type": "text"
},
{
"type": "local_block",
"name": "Local Block"
}
]
}
{% endschema %}
Anchor to ✓ Pass✓ Pass
In this example, local blocks are being used correctly within sections, and are not being used alongside theme blocks:
sections/local-block.liquid
{% schema %}
{
"name": "Section name",
"blocks": [
{
"type": "local_block",
"name": "Local Block"
}
]
}
{% endschema %}
Anchor to OptionsOptions
The following example contains the default configuration for this check:
ValidLocalBlocks
enabledtrue
severity error
Parameter | Description |
---|---|
enabled | Whether this check is enabled. |
severity | The severity of the check. |
Anchor to Disabling this checkDisabling this check
Disabling this check isn't recommended.
Was this page helpful?