UniqueStaticBlockId
Makes sure that all static blocks have a distinct ID defined.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
In the following example, there are two static blocks using the same ID:
{% content_for "block", type: "text", id: "static-block" %}
{% content_for "block", type: "text", id: "static-block" %}
Anchor to ✓ Pass✓ Pass
In the following example, the two static blocks have distinct IDs:
{% content_for "block", type: "text", id: "static-block-1" %}
{% content_for "block", type: "text", id: "static-block-2" %}
Anchor to OptionsOptions
The following example contains the default configuration for this check:
UniqueStaticBlockId
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?