Skip to main content

LiquidFreeSettings

Ensures that themes aren't using the {% liquid %} tag within Settings values. Settings values can't contain Liquid logic. This check only flags {% %} logic tags. Output tags ({{ }}) in setting values aren't affected.


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

In the following example, the {% liquid %} tag is used within a Settings value:

{% schema %}
{
"name": "Section name",
"settings": [
{
"id": "input_with_logic",
"type": "text",
"label": "Input with Logic",
"default": "Hello {% if user %} User {% endif %}!"
}
]
}
{% endschema %}

In the following example, the {% liquid %} tag isn't used within a Settings value:

{% schema %}
{
"name": "Section name",
"settings": [
{
"id": "input_with_logic",
"type": "text",
"label": "Input with Logic",
"default": "Hello User!"
}
]
}
{% endschema %}

Output tags ({{ }}) are allowed in setting values. For example, color_palette references and visible_if conditions both use this syntax:

{% schema %}
{
"name": "Section name",
"settings": [
{
"id": "heading_color",
"type": "color",
"label": "Heading color",
"default": "{{ settings.colors.primary }}"
}
]
}
{% endschema %}

The following example contains the default configuration for this check:

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