Deprecated filters

The filters listed below are now considered deprecated and have been replaced. Although they are still seen in some older themes, we recommend that you use the suggested alternatives.

Color filters

The following color filters are now deprecated:

hex_to_rgba

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

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

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

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
master Original image size

Want to discuss this page?

Visit the Shopify Community