Skip to main content

ValidContentForArguments

Makes sure that the arguments passed to the content_for tag are valid.

Note

For LiquidDoc checks take a look at UnrecognizedContentForArguments and MissingContentForArguments.


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

In the following example, the invalid named argument is not accepted by the content_for tag.

{% content_for "blocks", invalid: 10 %}
{% content_for "block", invalid: 10 %}

In the following example, all named attributes are accepted by the content_for tag.

{% content_for "blocks" %}
{% content_for "blocks", context.product: product %}
{% content_for "block", type: "slide", id: "my-static-slide" %}
{% content_for "block", type: "slide", id: "my-static-slide", context.product: product %}

The following example contains the default configuration for this check:

ValidContentForArguments:
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?