Skip to content

Liquid filters

Filters transform values: {{ product.price | money }}. Click any filter for syntax, parameters, and example output.

Filters come from two sources. The Standard filters at the bottom of this page are the liquidjs built-ins (abs, append, map, where, and so on) — the same general-purpose, Shopify-compatible surface you would find in any Liquid theme. Everything above them — money, image, color, font, URL, commerce, and the platform-specific string and data filters — is registered by Sellerlane and tuned for an Indian storefront: prices are stored in paise, money formats follow the store currency, and the metafield and recommendation filters read live store data.

A handful of filters listed below ship in the theme engine but do not yet have their own reference page. Their names and behaviour are documented inline in the relevant section.

Money

Money filters take an integer price in paise and render it in the store currency (₹ for INR storefronts), so 199900 | money becomes ₹1,999.00. For how prices, GST, and tax-inclusive display are calculated, see Taxes.

FilterDescription
moneyFormats a price (stored in paise) using the store currency.
money_with_currencyFormats a price and appends the ISO currency code.
money_without_currencyFormats the amount without a currency symbol.
money_without_trailing_zerosFormats a price, dropping “.00” when whole.
money_amountReturns the decimal amount as a number, for arithmetic.
weight_with_unitFormats a variant weight with its unit (e.g. 500 g); accepts an optional unit override.
unit_price_with_measurementRenders a price-per-unit string such as ₹50.00/100 ml from a price and a measurement object.

Images & media

Image and media filters resize and optimize from the CDN on the fly and render the right markup for each media type — <img>, an adaptive-streaming video player, an external-video embed, or an interactive 3D/AR viewer. For where these assets live, see Files; to upload 3D models, see Digital products.

FilterDescription
image_urlReturns a CDN URL for an image, resized and optimized on the fly. Requires width or height.
image_tagRenders a complete <img> element (srcset, sizes, alt, lazy-loading) from an image URL.
media_tagRenders any media object: image, adaptive-streaming video player, or interactive 3D/AR viewer.
video_tagRenders a <video> element with HLS and MP4 sources for a video media object.
external_video_tagRenders an <iframe> embed for an external (YouTube/Vimeo) video media object or URL.
external_video_urlReturns the embeddable URL for an external video media object.
model_viewer_tagRenders the interactive <model-viewer> element (GLB source) for a 3D model media object.
placeholder_svg_tagRenders a named placeholder SVG (e.g. product-1) for empty image slots.
asset_img_urlImage URL for a file in the theme’s assets/ folder, at a named size.
file_img_urlImage URL for an admin-uploaded file, at a named size.
preload_tagEmits <link rel="preload"> for a resource URL — use on the LCP hero image.
payment_type_img_urlURL of the icon for a payment type.
payment_type_svg_tagInline SVG tag for a payment type icon.

Colors

FilterDescription
color_to_rgbConverts a color to rgb()/rgba() notation.
color_to_hslConverts a color to hsl()/hsla() notation.
color_to_hexConverts a color to 6-digit hex.
color_to_oklchConverts a color to oklch() notation (modern CSS color space).
color_lightenLightens a color by a percentage.
color_darkenDarkens a color by a percentage.
color_saturateIncreases saturation by a percentage.
color_desaturateDecreases saturation by a percentage.
color_mixMixes two colors by weight.
color_modifySets one channel of a color (red, green, blue, alpha, hue, saturation, lightness).
color_extractReads one channel of a color.
color_brightnessPerceived brightness (0–255) — use to choose readable text color.
color_contrastWCAG contrast ratio between two colors.
color_differenceColor difference between two colors (0–765).
brightness_differenceBrightness difference between two colors (0–255).

Fonts

FilterDescription
font_faceEmits the @font-face CSS for a font setting.
font_familyThe CSS font-family stack for a font, including fallbacks.
font_urlCDN URL of the font file (woff2 by default).
font_modifyReturns a related font variant by property — e.g. font_modify: 'weight', 'bold'.
font_stylesheet_urlURL of a stylesheet covering the given fonts.
font_stylesheet_tagComplete <link rel="stylesheet"> tag for the given fonts.
FilterDescription
asset_urlVersioned CDN URL for a file in the theme’s assets/ folder.
global_asset_urlURL for a platform-provided shared asset.
shopify_asset_urlCompatibility alias for platform asset URLs (eases Shopify theme ports).
file_urlPublic URL for a file uploaded in the admin (Files).
stylesheet_tagRenders a <link rel="stylesheet"> for a URL.
script_tagRenders a <script src> tag for a URL.
inline_asset_contentInlines a theme asset’s raw contents into the page (ideal for SVG icons).
link_toBuilds an <a> tag.
link_to_tagLink that filters the current collection to one tag.
link_to_add_tagLink that adds a tag to the active collection filters.
link_to_remove_tagLink that removes a tag from the active collection filters.
link_to_typeLink to the automatic collection for a product type.
link_to_vendorLink to the automatic collection for a vendor.
url_for_typeURL of the automatic collection for a product type.
url_for_vendorURL of the automatic collection for a vendor.
highlight_active_tagWraps the tag in a highlight class when it is an active filter.
customer_login_linkLogin link for the customer account area.
customer_logout_linkLogout link for the signed-in customer.
customer_register_linkRegistration link for new customer accounts.
login_buttonRenders the platform login button.
url_escapePercent-encodes unsafe URL characters.
url_param_escapePercent-encodes a value for use as a query parameter (also encodes &).
encode_url_componentJavaScript-style encodeURIComponent.

Strings & data

FilterDescription
tTranslates a key from the theme’s locales/ files. Supports interpolation and counts.
translateAlias of t.
jsonSerializes any value or object to JSON.
api_jsonSerializes drops into the storefront-API JSON shape — for passing data to JavaScript.
structured_dataJSON-LD structured data (Product, Article…) for rich search results.
metafield_textRenders a metafield’s value as plain text, resolving its type (pass field: for a sub-field).
metafield_tagRenders a metafield’s value as type-aware HTML (rich text, list, image, money, and so on).
format_addressLocale-aware HTML for a postal address.
dateFormats a date with strftime patterns or named formats; locale-aware.
time_tagSemantic <time datetime> element with formatted text.
pluralizeChooses singular or plural based on a count.
camelizeConverts a string to CamelCase.
highlightWraps occurrences of the search terms in <strong class="highlight">.
base64_url_safe_encodeURL-safe Base64 encode.
base64_url_safe_decodeURL-safe Base64 decode.
blake3BLAKE3 hash of a string (hex).
defaultFallback when a value is nil, false, or empty.
default_paginationRenders prev/next page controls for a paginate block.
sort_byAppends a sort_by parameter to a collection URL.
withinScopes a product URL to a collection for collection-aware navigation.

Commerce

FilterDescription
product_inventory_jsonPer-variant live inventory payload used by themes for client-side availability.
payment_buttonRenders the dynamic checkout button for the current product form.
payment_termsRenders payment terms/installments messaging when available.
avatarAvatar element (initials) for a customer.
recommendations_for_productLive product recommendations for a given product/variant (and optional cart context).
recommendations_for_cartLive “complete the look” recommendations for the current cart.
recommendations_for_cart_drawerRecommendations sized and styled for the cart drawer.
recommendations_genericStore-wide recommendations with no specific product or cart anchor.
item_count_for_variantTotal quantity of a given variant currently in the cart.
line_items_forThe cart line items matching a given product or variant.
editor_settingTheme-editor binding attribute so a setting becomes click-to-edit in the visual editor. No output on the live store.

Standard

These are the liquidjs built-in filters — the general-purpose, Shopify-compatible surface available in every theme. They do not touch store data; they transform strings, numbers, and arrays.

FilterDescription
absAbsolute value.
appendAppends a string.
at_leastClamps a number to a minimum.
at_mostClamps a number to a maximum.
capitalizeUppercases the first character.
ceilRounds up.
compactRemoves nil values from an array.
concatConcatenates two arrays.
divided_byDivision.
downcaseLowercases a string.
escapeHTML-escapes a string.
escape_onceHTML-escapes without double-escaping entities.
firstFirst element of an array.
floorRounds down.
joinJoins array elements with a separator.
lastLast element of an array.
lstripStrips leading whitespace.
mapPlucks a property from each element.
minusSubtraction.
moduloRemainder.
newline_to_brConverts newlines to <br>.
plusAddition.
prependPrepends a string.
removeRemoves every occurrence of a substring.
remove_firstRemoves the first occurrence of a substring.
replaceReplaces every occurrence.
replace_firstReplaces the first occurrence.
reverseReverses an array.
roundRounds to the nearest integer or given decimals.
rstripStrips trailing whitespace.
sizeLength of a string or array.
sliceSubstring/sub-array by offset and length.
sortSorts an array (case-sensitive); pass a property to sort objects.
sort_naturalCase-insensitive sort.
splitSplits a string into an array.
stripStrips surrounding whitespace.
strip_htmlRemoves HTML tags.
strip_newlinesRemoves newline characters.
sumSums array values; pass a property name for objects.
timesMultiplication.
truncateTruncates to a length with an ellipsis.
truncatewordsTruncates to a word count.
uniqRemoves duplicates.
upcaseUppercases a string.
url_decodeDecodes percent-encoding.
url_encodePercent-encodes for URLs (spaces become +).
whereFilters an array of objects by property value.

Next steps