Truly theme developer docs Guides Reference (format 1)

Slots and styling

Slots

A slot is one of Truly's components. You place it with a tag; it draws itself:

{% slot 'service_picker' %}
{% slot 'consent', role: 'terms' %}
{% slot 'order', label_da: 'Bestil og betal', label_en: 'Order and pay' %}

Each page has slots it must place, per state: the routes and states reference lists them. The check refuses a package where a template, together with the layout and the snippets they render, never places a slot every state of its page requires, and warns about a slot only some states require. At render, Truly checks the page against the state it is in, so put a state-dependent slot behind the matching drop:

{% slot 'booking_status' %}
  {% if state.withdrawal %}{% slot 'withdrawal_notice' %}{% endif %}
{% endslot %}

Container slots

A container slot is a block: Truly draws its container (the step's section, the consents' region, a membership's card) at its place, and your markup and the slots between {% slot %} and {% endslot %} inside it, in your order. The legal parts sit inside their container, so you decide where in the step the consents, the withdrawal notice and the order go:

{% slot 'payment_step' %}
  {% if state.open %}
    {% slot 'order', label_da: 'Betal nu', label_en: 'Pay now' %}
    {% slot 'payment_consents' %}
      {% slot 'consent', role: 'perform_now' %}
      {% slot 'consent', role: 'terms' %}
    {% endslot %}
    {% slot 'payment_withdrawal' %}{% if state.withdrawal %}{% slot 'model_withdrawal_form' %}{% endif %}{% endslot %}
  {% endif %}
{% endslot %}

Each route's containers, and the slots each holds, are in the routes and states reference. A listed slot outside its container, a container inside one that is not its own, and a container without {% endslot %} fail the check; a slot your snippet places is checked when the page renders. On Min side's membership page the actions sit inside membership_status, which draws them in each membership's card; membership_termination must come before membership_pause.

Rules that hold everywhere:

The slots reference says what each slot draws.

Styling

Write normal CSS in assets/theme.css, with classes on your elements. Truly rebuilds the stylesheet from what it accepts (see the CSS reference) and serves it from its asset host.

Images and fonts

Put images in assets/ as PNG, JPEG or WebP (no SVG) and show them with <img src="{{ 'hero.webp' | asset_url }}" alt="…">; alt is required (empty for a decorative image). Truly re-encodes them as WebP. The tenant's logos come as drops: <img src="{{ tenant.logo.url }}" alt="{{ tenant.logo.alt }}"> inside {% if tenant.logo %}.

Fonts are WOFF2 files in assets/, loaded with @font-face { font-family: Brand; src: url(brand.woff2) format("woff2"); }. Make sure your licence allows web use.

Icons

Use {% icon 'arrow-right' %} for Truly's icon set; inline SVG is not allowed. The markup reference lists the icons.

Link to the tenant's website with an absolute https: URL, and between Truly's pages with route_url: the route id, then its params written literally in the template. Truly builds the URL (the tenant's domain, the language and campaign parameters).

<a href="{{ 'booking.locations' | route_url }}">All locations</a>
<a href="{{ 'booking.times' | route_url: location: 'norrebro', service: 12 }}">Book a haircut</a>

Each route on the routes page says whether it has a link and which params it takes. A param must match its pattern, or the page fails and falls back:

Param Value
location the location's slug in its URL (a-z, 0-9, -)
service, product, plan the service's, punch card's or gift card's, or membership plan's number in its URL
kind the legal text: terms, privacy, … as in its URL

A missing or extra param, or a route without a link (pages reached only from a link Truly sends, such as a booking's own page, and the error pages), fails the page. In a preview every link opens that route's preview. tel: and mailto: links are not allowed: print phone numbers and email addresses as text.