Altering the parameters of a filter based on input from the customizer

Altering the parameters of a filter based on input from the customizer

leocesario
Shopify Partner
12 0 2

Hi, Liquid newbie here.

 

Is it possible to alter the '244x' parameter in the img_url filter with a dynamic value that will be defined by the user in the Customizer?

{{ product | img_url: '244x' }}

 

Here's the schema:
{
"type": "text",
"id": "custom_image_size",
"label": "Custom Image Size",
"default": "244",
},

 

Screenshot of the Customizer:

leocesario_1-1710517199927.png

 

In order to do this, I've added an "assign" variable like so:
{% assign size = "'" | append: section.settings.custom_image_size | append: "x'" %}

Finally, the object was changed to this:

{{ product | img_url: size }}

But it's not working. Is this even possible or I am missing something?

 

Thanks!

Replies 0 (0)