MissingContentForArguments
When you render a static block, you must provide all required arguments defined in that block file's LiquidDoc.
Anchor to ExamplesExamples
The following examples contain code snippets that either pass or fail this check. Each example references this base block, which defines two parameters: one required and one optional (identified by square brackets).
blocks/example-block.liquid
{% doc %}
@param {string} some_str
@param {number} [some_num]
{% enddoc %}
Anchor to ✗ Fail✗ Fail
In the following example, the static block is being rendered without the required argument:
sections/section.liquid
{% content_for 'block', type: 'example-snippet', some_num: 1 %}
Anchor to ✓ Pass✓ Pass
In the following example, the required argument is being provided, but the optional argument is not:
sections/section.liquid
{% content_for 'block', type: 'example-snippet', some_str: 'text' %}
Anchor to ✓ Pass✓ Pass
In the following example, the required argument and the optional argument are being provided:
sections/section.liquid
{% content_for 'block', type: 'example-snippet', some_str: 'text', some_num: 1 %}
Anchor to OptionsOptions
The following example contains the default configuration for this check:
MissingContentForArguments
enabledtrue
severity warning
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?