Skip to main content

Overview

On top of the standard Nunjucks filters, SellAuth adds its own. Storefront themes and custom email templates get different sets, so each is listed separately below.

Theme filters

Available in every .njk file of a storefront theme.

URLs and assets

shopUrl is what makes links work correctly in both the live shop and the visual editor preview, so use it for every internal link rather than hardcoding a path.

Dates and numbers

Colors

hex_to_rgb expects a string. Guard it with a fallback as shown, because a setting that has never been saved is null and will throw.

Text and content

Apply renderString to any free-text setting a merchant might want to interpolate into. Applying it to platform data instead of settings has no useful effect. readingTime returns a number, so the surrounding copy stays yours to translate:
It only works where the full body is in the render context. blogPost on the blog post page carries content; the entries in blog_posts, latest_blog_posts, related_posts, prev_post and next_post do not, so it returns 0 there.

Data

json is safe inside a <script> block only. Do not use it in an HTML attribute or in body text. Use the built-in dump filter there instead.

Theme globals

Global functions are called directly rather than piped.

formatPrice

Formats a number as a currency string with the correct symbol. Falls back to <price> <currency> if the currency code is not recognized.

helpers

Handpicking products in a component:

Email templates

Custom email templates get no custom filters. Only the standard Nunjucks filters and this helper set are available: