Liquid Tag
Deprecated
This check only exists in Theme Check v1.X.X.
Deprecated:
This check only exists in Theme Check v1.X.X.
Recommends using {% liquid ... %} if four or more consecutive Liquid tags ({% ... %}) are found. This helps to eliminate repetitive tag markers ({% and %}) in theme files.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
{% if collection.image.size != 0 %}
{% assign collection_image = collection.image %}
{% elsif collection.products.first.size != 0 and collection.products.first.media != empty %}
{% assign collection_image = collection.products.first.featured_media.preview_image %}
{% else %}
{% assign collection_image = nil %}
{% endif %}
Anchor to ✓ Pass✓ Pass
{%- liquid
if collection.image.size != 0
assign collection_image = collection.image
elsif collection.products.first.size != 0 and collection.products.first.media != empty
assign collection_image = collection.products.first.featured_media.preview_image
else
assign collection_image = nil
endif
-%}
Anchor to OptionsOptions
LiquidTag
enabledtrue
min_consecutive_statements5
| Parameter | Description |
|---|---|
| enabled | Whether this check is enabled. |
| min_consecutive_statements | The maximum (inclusive) number of consecutive statements before the check recommends a refactor. |
Anchor to Disabling this checkDisabling this check
This check is safe to disable.
Was this page helpful?