Skip to Content
FluxStore is currently invite-only. Some sections of this documentation are still being written and expanded.
CustomizationCustom Templates

Custom Templates

Custom templates give you full HTML, CSS, and Liquid control over your storefront. They replace the built-in template entirely.

You do not need a custom template to make a beautiful, unique storefront. Between the built-in templates, Theme Editor, and Layout Editor, you can customize colors, fonts, layouts, hero sections, navigation styles, and much more without writing any code. Custom templates are for developers who want complete control over the HTML and CSS.

Getting started

Open the custom template editor at Dashboard > Customization > Custom Template. Write your template in the code editor on the left and use the preview panel on the right to see it rendered with your actual store data. Click Save to publish.

A syntax error in your Liquid code can result in a blank storefront. Always preview thoroughly before saving.

Available Liquid Variables

FluxStore injects several objects into your template at render time.

Store

VariableTypeDescription
store.namestringYour store’s display name
store.descriptionstringYour store’s description text
store.logostringURL to your store’s logo image
store.domainstringYour store’s domain (e.g. cosmic.fluxstore.net)

Products

VariableTypeDescription
categoriesarrayAll product categories
categories[].namestringCategory display name
categories[].slugstringCategory URL slug
categories[].packagesarrayPackages within the category
categories[].packages[].namestringPackage display name
categories[].packages[].pricenumberPackage price
categories[].packages[].descriptionstringPackage description (HTML)
categories[].packages[].imagestringURL to the package image

Cart

VariableTypeDescription
cart.itemsarrayItems currently in the cart
cart.items[].namestringItem name
cart.items[].quantitynumberItem quantity
cart.items[].pricenumberItem unit price
cart.totalnumberCart total amount
cart.countnumberTotal number of items in the cart

Theme Tokens

All tokens from the Themes reference are available under the theme object. For example: theme.primary, theme.background, theme.fontFamily, and theme.borderRadius.

Liquid Syntax

Templates use LiquidJS  syntax. Here is a quick overview of the basics.

Output variables with double curly braces:

<h1>{{ store.name }}</h1> <p>{{ store.description }}</p>

Loop over arrays with {% for %}:

{% for category in categories %} <h2>{{ category.name }}</h2> {% for package in category.packages %} <div class="package-card"> <h3>{{ package.name }}</h3> <p>{{ package.price | money }}</p> </div> {% endfor %} {% endfor %}

Conditionals with {% if %}:

{% if cart.count > 0 %} <div class="cart-badge">{{ cart.count }}</div> {% endif %}

Filters transform values inline. Some useful ones:

FilterDescriptionExample
moneyFormats a number as currency{{ package.price | money }}
upcaseConverts text to uppercase{{ store.name | upcase }}
truncateTruncates text to a given length{{ package.description | truncate: 100 }}

For the full list of tags and filters, see the LiquidJS documentation . FluxStore supports all standard LiquidJS tags and filters.

Example: Product Listing

<style> body { font-family: {{ theme.fontFamily }}; background: {{ theme.background }}; color: {{ theme.text }}; margin: 0; padding: 0; } .package-card { background: {{ theme.card }}; border: 1px solid {{ theme.border }}; border-radius: {{ theme.borderRadius }}; padding: {{ theme.cardPadding }}; } </style> <section style="padding: {{ theme.sectionPadding }};"> <h1>{{ store.name }}</h1> {% for category in categories %} <h2 style="color: {{ theme.primary }};">{{ category.name }}</h2> <div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;"> {% for package in category.packages %} <div class="package-card"> {% if package.image %} <img src="{{ package.image }}" alt="{{ package.name }}" /> {% endif %} <h3>{{ package.name }}</h3> <p style="color: {{ theme.textMuted }};">{{ package.description }}</p> <span style="color: {{ theme.primary }}; font-weight: bold;"> {{ package.price | money }} </span> </div> {% endfor %} </div> {% endfor %} </section>

CSS

Include your styles directly in the template with a <style> tag. You can reference theme tokens inside CSS values, as shown in the example above. This keeps everything in one file and lets your styles respond to theme changes automatically.