You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
liquid-rust version: 0.21.4
rust version: 1.49.0
OS: Any
I want to add a custom filter called url_param_escape, which is exactly the same function of a standard filter url_encode in the module. Can I bind new filter name to existing filter so that both filter name are valid and function the same way?
Edit:
This is my solution. originalFilter is the struct of original filter that impl Filter trait.
#[derive(Clone, ParseFilter, FilterReflection)]
#[filter(
name = "alias_name",
description = "Alias of original filter.",
parsed(originalFilter)
)]
pub struct AliasFilter;
The text was updated successfully, but these errors were encountered:
url_param_escape is a filter supported in shopify. It is very similar to url_encode. Before I posted this question, I want to find a way to do some alias mapping rather than duplicate all the codes from url_encode. Because I want to support both filters, not renaming.
But I just review shopify's document, there is slight difference between two filters. So I am going to write a custom one instead.
liquid-rust version: 0.21.4
rust version: 1.49.0
OS: Any
I want to add a custom filter called
url_param_escape
, which is exactly the same function of a standard filterurl_encode
in the module. Can I bind new filter name to existing filter so that both filter name are valid and function the same way?Edit:
This is my solution.
originalFilter
is the struct of original filter thatimpl Filter
trait.The text was updated successfully, but these errors were encountered: