# Theme filters

> The Liquid filters a theme template can use, grouped by what they work on.

This page lists all 158 Liquid filters registered in the theme engine, grouped by category with an example of each. Using an unlisted filter fails `biticaret theme check` and theme upload.

Filters accept named arguments: `image_url: width: 300`.

## Money

Prices are stored as whole integers in kuruş. These filters format them according to the store's currency settings.

| Filter | Description | Example |
| :--- | :--- | :--- |
| `money` | Formats an amount using the store's currency format. | `{{ product.price \| money }}` |
| `money_with_currency` | Formats an amount including the currency code. | `{{ cart.total_price \| money_with_currency }}` |
| `money_without_currency` | Formats the numeric amount without currency symbol or code. | `{{ product.price \| money_without_currency }}` |
| `money_without_trailing_zeros` | Formats an amount, omitting `.00` when there are no kuruş. | `{{ product.price \| money_without_trailing_zeros }}` |
| `money_amount` | Returns the formatted numeric amount without the currency symbol. | `{{ product.price \| money_amount }}` |
| `unit_price_with_measurement` | Formats a unit price alongside its unit measurement. | `{{ variant.unit_price \| money \| unit_price_with_measurement: variant.unit_price_measurement }}` |
| `currency_selector` | Generates a `<select>` element for switching currencies. | `{{ form \| currency_selector }}` |

## Images and media

| Filter | Description | Example |
| :--- | :--- | :--- |
| `image_url` | Generates an image URL at the requested dimensions (`width`, `height`, `crop`). | `{{ product.featured_media \| image_url: width: 800 }}` |
| `image_tag` | Generates an `<img>` tag from an image URL. | `{{ product.featured_media \| image_url: width: 400 \| image_tag: loading: 'lazy' }}` |
| `img_url` | Legacy form of `image_url`; takes a named size string. | `{{ product.featured_image \| img_url: '400x' }}` |
| `img_tag` | Legacy form of `image_tag`. | `{{ product.featured_image \| img_url: '400x' \| img_tag }}` |
| `product_img_url`, `collection_img_url`, `article_img_url` | Legacy resource-specific aliases for `img_url`. | `{{ product.featured_image \| product_img_url: '400x' }}` |
| `media_tag` | Renders HTML for a media object by type (image, video, external video, 3D model). | `{{ media \| media_tag }}` |
| `video_tag` | Generates a `<video>` element from an uploaded video. | `{{ section.settings.video \| video_tag: controls: true }}` |
| `external_video_url` | Returns the embed URL for a YouTube or Vimeo video. | `{{ media \| external_video_url: autoplay: true }}` |
| `external_video_tag` | Generates an `<iframe>` embed for an external video. | `{{ media \| external_video_url \| external_video_tag }}` |
| `model_viewer_tag` | Generates a `<model-viewer>` element for a 3D model. | `{{ media \| model_viewer_tag }}` |
| `placeholder_svg_tag` | Renders a built-in placeholder SVG illustration. | `{{ 'product-1' \| placeholder_svg_tag }}` |
| `payment_type_img_url` | Returns the icon URL for a payment method. | `{{ type \| payment_type_img_url }}` |
| `payment_type_svg_tag` | Renders an inline SVG icon for a payment method. | `{{ type \| payment_type_svg_tag }}` |

## Asset and file addresses

| Filter | Description | Example |
| :--- | :--- | :--- |
| `asset_url` | Returns the URL of a file in the theme's `assets/` folder with `?v=`. | `{{ 'base.css' \| asset_url }}` |
| `asset_img_url` | Returns a sized image URL for a file in `assets/`. | `{{ 'logo.png' \| asset_img_url: '300x' }}` |
| `file_url` | Returns the URL of a store uploaded file. | `{{ 'catalogue.pdf' \| file_url }}` |
| `file_img_url` | Returns a sized URL for an image in the store's files. | `{{ 'poster.jpg' \| file_img_url: '600x' }}` |
| `biticaret_asset_url` | Returns the URL of a shared platform asset. | `{{ 'option_selection.js' \| biticaret_asset_url }}` |
| `global_asset_url` | Returns a global platform asset URL. | `{{ 'x.js' \| global_asset_url }}` |
| `inline_asset_content` | Outputs the raw contents of an asset inline (SVG, CSS, JavaScript). | `{{ 'icon-cart.svg' \| inline_asset_content }}` |
| `stylesheet_tag` | Wraps a CSS URL in `<link rel="stylesheet">`. | `{{ 'base.css' \| asset_url \| stylesheet_tag }}` |
| `script_tag` | Wraps a JS URL in `<script>`. | `{{ 'theme.js' \| asset_url \| script_tag }}` |
| `preload_tag` | Generates a `<link rel="preload">` tag from a URL. | `{{ 'base.css' \| asset_url \| preload_tag: as: 'style' }}` |

## Links

| Filter | Description | Example |
| :--- | :--- | :--- |
| `link_to` | Generates an `<a>` tag from label text and a URL. | `{{ 'Cart' \| link_to: routes.cart_url }}` |
| `link_to_type` | Generates a link to a product type collection. | `{{ product.type \| link_to_type }}` |
| `link_to_vendor` | Generates a link to a vendor collection. | `{{ product.vendor \| link_to_vendor }}` |
| `url_for_type` | Returns the URL for a product type collection. | `{{ product.type \| url_for_type }}` |
| `url_for_vendor` | Returns the URL for a vendor collection. | `{{ product.vendor \| url_for_vendor }}` |
| `link_to_tag` | Generates a link that filters a collection by a tag. | `{{ tag \| link_to_tag: tag }}` |
| `link_to_add_tag` | Generates a link that adds a tag to active collection filters. | `{{ tag \| link_to_add_tag: tag }}` |
| `link_to_remove_tag` | Generates a link that removes a tag from active collection filters. | `{{ tag \| link_to_remove_tag: tag }}` |
| `highlight_active_tag` | Wraps an active tag in `<span class="active">`. | `{{ tag \| highlight_active_tag }}` |
| `within` | Scopes a product URL within a collection path. | `{{ product.url \| within: collection }}` |
| `sort_by` | Appends a sort parameter to a collection URL. | `{{ collection.url \| sort_by: 'price-ascending' }}` |
| `customer_login_link` | Generates a link to the customer sign-in page. | `{{ 'Sign in' \| customer_login_link }}` |
| `customer_logout_link` | Generates a customer sign-out link. | `{{ 'Sign out' \| customer_logout_link }}` |
| `customer_register_link` | Generates a link to the customer registration page. | `{{ 'Sign up' \| customer_register_link }}` |

## Translation, dates and formatting

| Filter | Description | Example |
| :--- | :--- | :--- |
| `t`, `translate` | Looks up a localized string from `locales/`; supports interpolation and `count` plurals. | `{{ 'general.skip_to_content' \| t }}` |
| `date` | Formats a timestamp using format directives. | `{{ order.created_at \| date: '%d.%m.%Y' }}` |
| `time_tag` | Generates an HTML `<time>` element from a timestamp. | `{{ order.created_at \| time_tag }}` |
| `format_address` | Formats an address across lines. | `{{ customer.default_address \| format_address }}` |
| `weight_with_unit` | Formats a weight in grams with its unit label. | `{{ variant.weight \| weight_with_unit }}` |
| `pluralize` | Selects singular or plural form based on a number. | `{{ cart.item_count \| pluralize: 'item', 'items' }}` |
| `default_pagination` | Generates pagination links from a `paginate` object. | `{{ paginate \| default_pagination }}` |
| `default_errors` | Outputs form errors as an HTML list. | `{{ form.errors \| default_errors }}` |
| `structured_data` | Generates JSON-LD structured data for a product. | `{{ product \| structured_data }}` |
| `json` | Serializes a value as JSON. | `{{ product.variants \| json }}` |
| `highlight` | Highlights search terms inside a string. | `{{ item.title \| highlight: search.terms }}` |
| `class_list` | Builds CSS class names from a settings object. | `{{ section.settings \| class_list }}` |

## Cart

| Filter | Description | Example |
| :--- | :--- | :--- |
| `item_count_for_variant` | Returns the quantity of a variant currently in the cart. | `{{ cart \| item_count_for_variant: variant.id }}` |
| `line_items_for` | Returns cart line items matching a product or variant. | `{{ cart \| line_items_for: product }}` |

## Fonts

| Filter | Description | Example |
| :--- | :--- | :--- |
| `font_face` | Outputs an `@font-face` CSS rule for a font. | `{{ settings.type_body_font \| font_face: font_display: 'swap' }}` |
| `font_modify` | Returns a variant of the font with a different weight or style. | `{{ settings.type_body_font \| font_modify: 'weight', 'bold' }}` |
| `font_url` | Returns the URL of the font file. | `{{ settings.type_body_font \| font_url }}` |

## Colors

| Filter | Description | Example |
| :--- | :--- | :--- |
| `color_to_rgb` | Formats a color as `rgb()`. | `{{ settings.color_text \| color_to_rgb }}` |
| `color_to_hex` | Formats a color as hex. | `{{ settings.color_text \| color_to_hex }}` |
| `color_to_hsl` | Formats a color as `hsl()`. | `{{ settings.color_text \| color_to_hsl }}` |
| `color_to_oklch` | Formats a color as `oklch()`. | `{{ settings.color_text \| color_to_oklch }}` |
| `color_extract` | Extracts one channel/component of a color. | `{{ settings.color_text \| color_extract: 'red' }}` |
| `color_modify` | Modifies one channel/component of a color. | `{{ settings.color_text \| color_modify: 'alpha', 0.5 }}` |
| `color_lighten` | Lightens a color by a percentage. | `{{ settings.color_accent \| color_lighten: 20 }}` |
| `color_darken` | Darkens a color by a percentage. | `{{ settings.color_accent \| color_darken: 20 }}` |
| `color_saturate` | Increases color saturation. | `{{ settings.color_accent \| color_saturate: 20 }}` |
| `color_desaturate` | Decreases color saturation. | `{{ settings.color_accent \| color_desaturate: 20 }}` |
| `color_mix` | Blends two colors together. | `{{ settings.color_text \| color_mix: settings.color_background, 50 }}` |
| `color_brightness` | Calculates a color's perceived brightness. | `{{ settings.color_background \| color_brightness }}` |
| `color_contrast` | Calculates the contrast ratio between two colors. | `{{ settings.color_text \| color_contrast: settings.color_background }}` |
| `color_difference` | Calculates the color difference between two colors. | `{{ settings.color_text \| color_difference: settings.color_background }}` |
| `brightness_difference` | Calculates the brightness difference between two colors. | `{{ settings.color_text \| brightness_difference: settings.color_background }}` |
| `hex_to_rgba` | Converts a hex color to `rgba()` with the given opacity. | `{{ '#1a1a1a' \| hex_to_rgba: 0.5 }}` |

## Text

When the store's language is Turkish, `upcase`, `downcase` and `capitalize` follow Turkish casing rules (`İ` ↔ `i`, `I` ↔ `ı`).

| Filter | Description | Example |
| :--- | :--- | :--- |
| `append` | Appends a string to the end. | `{{ product.handle \| append: '.jpg' }}` |
| `prepend` | Prepends a string to the start. | `{{ product.title \| prepend: '★ ' }}` |
| `upcase` | Converts a string to uppercase. | `{{ product.vendor \| upcase }}` |
| `downcase` | Converts a string to lowercase. | `{{ product.vendor \| downcase }}` |
| `capitalize` | Capitalises the first character of a string. | `{{ product.type \| capitalize }}` |
| `camelize` | Converts a string to CamelCase. | `{{ 'main-menu' \| camelize }}` |
| `handle`, `handleize` | Converts a string into a URL-friendly handle. | `{{ product.title \| handleize }}` |
| `escape`, `h` | HTML-escapes special characters. | `{{ section.settings.heading \| escape }}` |
| `escape_once` | HTML-escapes without double-escaping existing entities. | `{{ page.title \| escape_once }}` |
| `strip_html` | Strips all HTML tags. | `{{ product.description \| strip_html }}` |
| `strip_newlines` | Removes line breaks. | `{{ product.description \| strip_newlines }}` |
| `newline_to_br` | Converts line breaks to `<br>` tags. | `{{ cart.note \| newline_to_br }}` |
| `strip`, `lstrip`, `rstrip` | Trims whitespace from both ends, start only, or end only. | `{{ cart.note \| strip }}` |
| `squish` | Collapses consecutive whitespace into single spaces and trims ends. | `{{ product.title \| squish }}` |
| `truncate` | Truncates a string to a maximum character count. | `{{ product.title \| truncate: 40 }}` |
| `truncatewords` | Truncates a string to a maximum word count. | `{{ product.description \| strip_html \| truncatewords: 20 }}` |
| `replace`, `replace_first`, `replace_last` | Replaces every, the first, or the last occurrence of a substring. | `{{ product.title \| replace: '-', ' ' }}` |
| `remove`, `remove_first`, `remove_last` | Removes every, the first, or the last occurrence of a substring. | `{{ product.title \| remove: '!' }}` |
| `split` | Splits a string into an array on a separator. | `{{ product.tags \| join: ',' \| split: ',' }}` |
| `slice` | Extracts a substring or subarray. | `{{ product.title \| slice: 0, 10 }}` |
| `size` | Returns the length of a string or array. | `{{ product.tags \| size }}` |
| `url_encode` | URL-encodes a string. | `{{ search.terms \| url_encode }}` |
| `url_decode` | Decodes a URL-encoded string. | `{{ 'a%20b' \| url_decode }}` |
| `url_escape` | Escapes characters that are invalid in a URL. | `{{ link.url \| url_escape }}` |
| `url_param_escape` | Escapes a string for use as a query parameter value. | `{{ search.terms \| url_param_escape }}` |
| `base64_encode`, `base64_decode` | Encodes or decodes standard Base64. | `{{ 'text' \| base64_encode }}` |
| `base64_url_safe_encode`, `base64_url_safe_decode` | Encodes or decodes URL-safe Base64. | `{{ 'text' \| base64_url_safe_encode }}` |
| `md5`, `sha1`, `sha256` | Computes the cryptographic hash digest of a string. | `{{ customer.email \| sha256 }}` |
| `hmac_sha1`, `hmac_sha256` | Computes an HMAC digest using a secret key. | `{{ 'text' \| hmac_sha256: 'key' }}` |
| `default` | Returns a fallback value when the input is empty or `false`. | `{{ section.settings.heading \| default: shop.name }}` |

## Numbers

| Filter | Description | Example |
| :--- | :--- | :--- |
| `plus`, `minus` | Adds or subtracts. | `{{ cart.item_count \| plus: 1 }}` |
| `times`, `divided_by` | Multiplies or divides. | `{{ product.price \| times: 2 }}` |
| `modulo` | Returns the division remainder. | `{{ forloop.index \| modulo: 2 }}` |
| `abs` | Returns the absolute value. | `{{ -5 \| abs }}` |
| `ceil`, `floor`, `round` | Rounds up, down, or to the nearest integer. | `{{ 4.6 \| round }}` |
| `at_least`, `at_most` | Clamps a number to a minimum or maximum bound. | `{{ cart.item_count \| at_most: 99 }}` |

## Lists

| Filter | Description | Example |
| :--- | :--- | :--- |
| `first`, `last` | Returns the first or last item. | `{{ product.images \| first }}` |
| `join` | Joins items with a separator. | `{{ product.tags \| join: ', ' }}` |
| `map` | Extracts one property from each item. | `{{ collection.products \| map: 'title' \| join: ', ' }}` |
| `where` | Keeps items whose property matches a value. | `{{ collection.products \| where: 'available', true }}` |
| `reject` | Inverse of `where`: drops matching items. | `{{ collection.products \| reject: 'available', false }}` |
| `find` | Returns the first matching item. | `{{ product.variants \| find: 'available', true }}` |
| `find_index` | Returns the index of the first matching item. | `{{ product.variants \| find_index: 'available', true }}` |
| `has` | Returns whether any item matches. | `{{ product.variants \| has: 'available', true }}` |
| `sort` | Sorts items, optionally by a property name. | `{{ collection.products \| sort: 'price' }}` |
| `sort_natural` | Sorts strings case-insensitively. | `{{ collection.all_tags \| sort_natural }}` |
| `reverse` | Reverses the item order. | `{{ product.images \| reverse }}` |
| `uniq` | Removes duplicate items. | `{{ collection.products \| map: 'vendor' \| uniq }}` |
| `compact` | Removes `nil`/empty items. | `{{ collection.products \| map: 'featured_image' \| compact }}` |
| `concat` | Concatenates two arrays. | `{{ product.tags \| concat: collection.all_tags }}` |
| `sum` | Sums numeric items, or a numeric property across items. | `{{ cart.items \| sum: 'quantity' }}` |

## Accepted but empty

These filters are recognised so they pass template validation, though they currently output an empty string: `payment_button`, `payment_terms`, `avatar`, `login_button`, `metafield_tag`, `metafield_text`.

## Debugging

| Filter | Description | Example |
| :--- | :--- | :--- |
| `inspect` | Outputs the value's internal representation. | `{{ product.tags \| inspect }}` |
| `type` | Outputs the value's engine type name. | `{{ product.price \| type }}` |
