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' %}
The order label names a payment, so it applies only when something is paid online. Where nothing is paid (a booking with no amount due), the button books the time and reads "Book tiden" / "Book the time" whatever the label says.
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 %}
A field's value is a quoted literal; true may also be written bare. The account forms (signup_form, sign_in_form, sign_in_code_form, profile_logins) take bare: true: the form without Truly's heading and without the card around it, so your own heading does not stack with ours. On Min side and the sign-in pages a bare form also has no main of its own, so place it inside yours. The profile page places either profile_logins or all three of its parts, each once, so you can lay them out yourself; each part also takes bare: true, which leaves out its card and its subheading so you head your columns:
<h1>{{ 'profile.title' | t }}</h1>
<div class="columns">
<section><h2>{{ 'profile.contact' | t }}</h2>{% slot 'profile_contact', bare: true %}</section>
<section><h2>{{ 'profile.sign_in' | t }}</h2>{% slot 'profile_sign_in', bare: true %}{% slot 'profile_locale', bare: true %}</section>
</div>
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. To draw the membership cards yourself from memberships, place {% slot 'membership_status', membership: 'next' %} once inside {% for m in memberships %}, each holding that membership's membership_termination: the Nth one holds the Nth membership's actions, so loop over memberships in its own order (not reversed or sorted). A page that places a different number than there are memberships falls back to Truly's default theme. If you print the pause rules yourself from memberships[].pause, write {% slot 'membership_pause', bare: true %}: the pause form without its heading and its own list of the rules.
To draw the details step your own way, write {% slot 'details_form', bare: true %}: the slot then draws only the form (the fields, the parts you place inside it, the submit), without Truly's heading, the accepted payment methods or the recap of the done steps. Draw those yourself from summary and payment_methods, inside your own main; the customer must see the payment methods before ordering.
The payment step takes {% slot 'payment_step', bare: true %} the same way: no step heading and no recap, so draw them from summary (the held booking, without change links: its price, what is charged now in due_today and, for a deposit, the rest for the salon in in_salon); the messages, the code field, the cancellation fee, the hold's countdown and the parts you place inside stay.
The booking's own page takes {% slot 'booking_status', bare: true %} too: no heading, order card or "Book en ny tid", so draw them from summary, order (a booking paid online), receipt_email and new_time_url, and word the heading by state.status and state.payment; the hold's countdown, the status messages, the withdrawal notice you place inside, the account code field and the referral welcome stay.
When the chosen time is gone (someone else booked it, or it is no longer offered), the details step renders in its stale state: place {% slot 'stale_slot' %} there instead of details_form. It draws Truly's step around the notice and the day's other free times; with bare: true only the notice and the times, so you head the page yourself (stale.date and stale.time name the lost time, summary the rest of the choice):
{% if state.stale %}
<main><h1>{{ 'details.taken' | t }}</h1>{% slot 'stale_slot', bare: true %}</main>
{% else %}
{% slot 'details_form', bare: true %}…{% endslot %}
{% endif %}
While the seller has closed its public sales, every booking and purchase page answers with the errors.sales_closed page instead: place {% slot 'sales_closed' %} in it, inside your shell. With bare: true it draws only the text and the call link, so head it yourself: <main><h1>{{ sales_closed.title }}</h1>{% slot 'sales_closed', bare: true %}</main>.
Every other page's own slot takes bare: true too, so no customer page has to keep Truly's look: the booking steps' pickers, the payment's return page (order_status), the payment link, the waitlist and offer pages, the withdrawals, the price list, the punch card, gift card and membership pages, the card link pages, the rebooking and unsubscribe pages, the legal texts, the error pages (not_found, too_many_requests, form_expired) and every Min side page. Bare leaves out Truly's heading, its own main, the recap or summary card and any button to a public page; the messages, forms, legal parts and links that carry a secret (a retry payment, a withdrawal link) stay. Draw what was left out from the route's drops (state, summary, me) and link on with route_url. Each slot's reference entry says what its bare form keeps. A form sent after it was open too long now answers with the errors.form_expired page (place {% slot 'form_expired' %}), not a plain error page.
To list the payment methods the tenant accepts, place {% slot 'payment_marks' %} where you want them, on any page, inside a container or not, and as often as you like, after your own label: <p>Vi tager imod</p>{% slot 'payment_marks' %}. Truly draws the brands' own marks (their rules forbid recolouring or resizing one against the others), from the tenant's online payment setting, on every page (unlike payment_methods, which a booking page lists only where payment is taken).
Rules that hold everywhere:
- The layout places
{% slot 'footer' %}and prints{{ content_for_layout }}once, both at its top level, outside anyif,foror other block and not in a snippet. - Pages where tracking tags may load require
{% slot 'cookie_banner' %}; it is simplest to place it in the layout, where it is allowed on every page. - A slot that is not a container has no content of its own, and no slot can sit inside a link.
- The legal slots (the consents, the withdrawal notice and form, and the order) cannot be replaced or split: the order slot always draws the order summary directly followed by the order button.
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.
- Your rules apply to your own markup and stop at slots:
button { … }styles your buttons, never Truly's. Your markup inside a container slot is yours again, so your rules reach it and stop at the slots inside it. - Inherited properties do flow into slots:
color,font-family,font-sizeandline-heighton a wrapper style the component inside. - To recolour Truly's components, set the
--truly-…custom properties on your own element around the slots, as in.page { --truly-color-primary: #1a1a1a; --truly-radius: 0; }. The slots reference lists them. - To make the order summary a dark bar, set
--truly-order-background,--truly-order-foregroundand--truly-order-muted-foregroundon[data-part="order"](or a wrapper): they recolour the summary's background, its text and its labels, and the muted colour also the notes and seller line under the button (outside the summary box), so paint the whole part's background too when the muted colour is light. - To style inside a component, select its hooks: a rule whose last part is a
[data-part="…"]reaches into the slot, as in.checkout [data-part="order"] { gap: 2rem; }. A part further left ([data-part="order"] button) stays outside. The slots reference lists each slot's hooks; they keep working for themes of the sameformat_version. - Truly's headings inside a slot keep Truly's weight and size until you style them:
[data-part="subheading"]is a card's title, a section's heading, a form group's or a consent's title, a booking step's section heading or a time-of-day group, and the footer's and cookie banner's headings ("Fortrydelsesret", "Dine kort", "Afbestilling og udeblivelse", "Modtager", "Medlemsvilkår", "Nye ledige tider"),[data-part="alert-title"]an alert's title, as in.page [data-part="subheading"] { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; }. Legal headings stay on the page; you change how they look, not what they say. - The code boxes (the sign-in code, and a code asked when adding a login) are a row at most 20rem wide of six squares.
[data-part="code"]is the row and[data-part="code-slot"]each box:.login [data-part="code"] { max-width: none; width: 100%; } .login [data-part="code-slot"] { aspect-ratio: auto; height: 64px; }stretches them across the form. - To size the payment marks, set
--truly-payment-mark-heighton[data-part="marks"]or a wrapper, as in.site-footer { --truly-payment-mark-height: 20px; }; every mark keeps the same height and its own width. - No ids, no
:has(), no other attribute selectors and nostyleattributes.
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.
Links
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). When the page is drawn, Truly adds the visitor's attribution (the referrer and the Reserve with Google token) to every link on the booking page's own host, so a booking made through your links is credited as one made through Truly's pickers; links to other hosts get nothing.
<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.