Skip to main content

UniqueStaticBlockId

Makes sure that all static blocks have a distinct ID defined.


The following examples contain code snippets that either fail or pass this check.

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" %}

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" %}

The following example contains the default configuration for this check:

UniqueStaticBlockId:
enabled: true
severity: error
ParameterDescription
enabledWhether this check is enabled.
severityThe severity of the check.

Anchor to Disabling this checkDisabling this check

Disabling this check isn't recommended.


Was this page helpful?