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
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:
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
Theme globals
Global functions are called directly rather than piped.formatPrice
<price> <currency> if the currency code is not recognized.
helpers
Handpicking products in a component: