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.
Note:
For LiquidDoc checks take a look at UnrecognizedContentForArguments and MissingContentForArguments.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
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 %}
Anchor to ✓ Pass✓ Pass
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 %}
Anchor to OptionsOptions
The following example contains the default configuration for this check:
ValidContentForArguments
enabledtrue
severityerror
| 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?