Question

Liquid Filters Documentation

  • 4 November 2021
  • 1 reply
  • 33 views

Userlevel 2

I stumbled across this reference at the bottom of the liquid variables reference page for handling filters as a liquid variable.

{{ _filters['view_name.field_name'] | split:"," | sql_quote | join:"," }}

That end portion with the “split” and “join” functions, I decided to try something with a “remove” function that ended up working.

For example, if the “view_name.field_name” in the filter was “Mississippi” and I used the following liquid filter, we would get the following returned.

{{ _filters['view_name.field_name'] | remove:"i"}}

returns: "Msssspp"

Another use case would be stripping the “%” from a “contains” filter to just get the value elsewhere.

 

Is there any documentation that discusses the different operators/functions like “split”, “join”, “remove” and how to best use them?


1 reply

Userlevel 1

Hi Minerkt,

You can find  more information and examples about liquid template engine here:

- Split:

Liquid reference - split

- Join:

Liquid reference - join

​​​​​​​ - Remove:

Liquid reference - remove

 

- Full documentation:

Liquid reference - Shopify

 

Happy debugging!

Leo

Reply