Skip to main content

DuplicateContentForArguments

Each named argument should be passed into the content_for tag only once.


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

The following example will fail because it contains two identically named arguments:

{% content_for 'block', type: 'example-block', some_input: 'text', some_input: 'more text' %}

The following example will pass because the arguments have different names:

{% content_for 'block', type: 'example-block', some_input_1: 'text', some_input_2: 'more text' %}

The following example contains the default configuration for this check:

DuplicateContentForArguments:
enabled: true
severity: warning
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?