Skip to main content

MissingContentForArguments

When you render a static block, you must provide all required arguments defined in that block file's LiquidDoc.


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

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

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

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

The following example contains the default configuration for this check:

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