Additional Filters - dotliquid/dotliquid GitHub Wiki

Contributors have submitted a collection of filters that are not found in the Ruby Liquid reference library. These can be useful to the DotLiquid community. The standard filters can be found at Liquid Filters and are enabled automaticaly.

For Designers

Additional filter categories can be enabled on a per-render basis using [Runtime Settings]. For example, adding {%param using='ShopifyFilters'%} to a template would enable all filters in the ShopifyFilters category (see table below).

For Developers

Filter categories can be registered globally with the Template.RegisterFilter method. For example Template.RegisterFilter(typeof(ExtendedFilters)); would register all filters in the ExtendedFilters category. You may also create your own filters and either register them or whitelist them for designers to opt-in with the Template.SafelistFilter method.

Filters

Filter Category Description
currency N/A - available by default Converts the input object into a formatted currency as specified by the context culture.
h N/A - available by default Deprecated, use the Liquid escape filter instead.
hmac_sha1 ShopifyFilters
hmac_sha256 ShopifyFilters
json ShopifyFilters
md5 ShopifyFilters
sha1 ShopifyFilters
sha256 ShopifyFilters
titleize ExtendedFilters Capitalize all the words in the input sentence.
upcase_first ExtendedFilters Converts just the first (non-whitespace) character to uppercase. (This differs from capitalize as subsequent characters are not altered to lowercase.)