--- title: SchemaPresetsBlockOrder description: >- Identifies when the schema presets blocks are correctly used in the block_order attribute. source_url: html: >- https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order md: >- https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md --- ExpandOn this page * [Examples](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md#examples) * [Options](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md#options) * [Disabling this check](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md#disabling-this-check) # SchemaPresetsBlockOrder Makes sure that the schema presets blocks are correctly used in the `block_order` attribute. *** ## Examples The following examples contain code snippets that either fail or pass this check. ### ✗ Fail In the following example, the `block_order` attribute is missing the `block_2` block: ```liquid {% schema %} "presets": [ { "name": "My preset", "blocks": { "block_1": { "type": "text" }, "block_2": { "type": "text" } }, "block_order": ["block_1"] } ] {% endschema %} ``` ### ✗ Fail In the following example, `block_2` is static and is included in the `block_order` attribute, even though it shouldn't be: ```liquid {% schema %} "presets": [ { "name": "My preset", "blocks": { "block_1": { "type": "text" }, "block_2": { "type": "text", "static": true } }, "block_order": ["block_1","block_2"] } ] {% endschema %} ``` ### ✗ Fail In the following example, the `block_2` is in `block_order` but is not defined in `blocks`: ```liquid {% schema %} "presets": [ { "name": "My preset", "blocks": { "block_1": { "type": "text" } }, "block_order": ["block_1", "block_2"] } ] {% endschema %} ``` ### ✓ Pass In the following example, the `block_order` attribute contains the correct blocks: ```liquid {% schema %} "presets": [ { "name": "My preset", "blocks": { "block_1": { "type": "block_1" }, "block_2": { "type": "block_2", "static": true } }, "block_order": [ "block_1" ] } ] {% endschema %} ``` *** ## Options The following example contains the default configuration for this check: ```yaml SchemaPresetsBlockOrder: enabled: true severity: warning ``` | Parameter | Description | | - | - | | `enabled` | Whether this check is enabled. | | `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. | *** ## Disabling this check Disabling this check isn't recommended. *** * [Examples](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md#examples) * [Options](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md#options) * [Disabling this check](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/schema-presets-block-order.md#disabling-this-check)