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

Shopify Partner
12 0 1

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:



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?



Replies 0 (0)