Deprecated filters
The following Liquid filters are considered deprecated, and have been replaced. They are still used in some themes, but it's recommended that you use the alternatives that are listed below.
Color filters
The following color filters are now deprecated:
hex_to_rgba
See alternatives:
color_to_rgb
,color_modify
Theme settings return hexadecimal values for color settings by default. Use the hex_to_rgba
filter to convert the value into RGBA. It defaults to an opacity of 1
, but you can specify an opacity between 0 and 1. Shorthand hex values are accepted as well, for example, #812
.
Input
.site-footer h1 {
color: {{ settings.color_name }};
}
.site-footer p {
color: {{ settings.color_name | hex_to_rgba: 0.5 }};
}
Output
.site-footer h1 {
color: #812dd3;
}
.site-footer p {
color: rgba(129, 45, 211, 0.5);
}
URL filters
The following url filters are now deprecated:
collection_img_url
See alternative:
img_url
Returns the collection image's URL. Accepts an image size as a parameter.
Input
{{ collection.image | collection_img_url: 'medium' }}
Output
//cdn.shopify.com/s/files/1/0087/0462/collections/collection-image_medium.png?v=1337103726
product_img_url
See alternative:
img_url
Generates the product image URL. Accepts an image size as a parameter.
Input
{{ product.featured_image | product_img_url: "medium" }}
Output
//cdn.shopify.com/s/files/1/0087/0462/products/shirt14_medium.jpeg?v=1309278311
Named size parameters
See alternative: numeric size parameters
Instead of using a numeric image size, some older themes use a named size as a parameter for img_url
.
Name | Maximum image size |
---|---|
pico | 16 x 16 pixels |
icon | 32 x 32 pixels |
thumb | 50 x 50 pixels |
small | 100 x 100 pixels |
compact | 160 x 160 pixels |
medium | 240 x 240 pixels |
large | 480 x 480 pixels |
grande | 600 x 600 pixels |
original | 1024 x 1024 pixels |
Date formats
Date formats are used with certain filters, such as time_tag
and date
.
The following format
parameters are now deprecated:
short
long
Input
{{ article.published_at | time_tag: format: 'short' }}
Output
<time datetime="2016-02-24T14:47:51Z">February 24, 2016</time>