Skip to main content

Edit a template

The core authoring loop. You work in a side-by-side workspace: the template on the left, a live preview on the right, and a tools sidebar that inserts the pieces so you rarely have to type placeholder names by hand.

Before you begin

Insert a piece of data

  1. Open the Variables tab in the tools sidebar. It's a searchable tree of everything this document type can print, grouped into sections like Store, Customer or Supplier, Billing Address, Shipping Address, Items, Order Meta, Totals, Conditional Flags, your Custom Fields, and your uploaded images.
  2. Type in the search box to narrow the list — matching groups open automatically.
  3. Click an entry to drop it in at your cursor, or drag it and release it exactly where you want it.

The groups change with the template type: a purchase order shows Supplier where a sales order shows Customer. The panel for the template you have open is the authoritative list of what that document can print — if it isn't there, the template can't print it.

Repeat a row for every item

Groups that repeat — Items on an order, Financial Lines, pick rows on a pick list — are marked with a blue loop tag.

  1. Expand the group. A Loop block entry sits at the top.
  2. Click Loop block. The opening and closing tags are inserted with a blank line between them.
  3. Put your table row (or paragraph, or serial-number line) on that blank line.
  4. Insert the per-row fields listed under the group inside the block.

Anything between the tags prints once per line item. Anything outside prints once for the whole document.

A misspelled field inside a loop prints nothing

A name that doesn't exist prints as blank rather than raising an error, so a typo inside a repeating block produces a table of empty cells rather than a message. Insert fields by clicking them in the panel instead of typing them.

Move or hide a whole section

There's no drag-and-drop layout panel. The markup is the layout, so a section moves when you move its block of markup.

  1. In the Code Editor, select the whole section — its opening tag down to its closing tag.
  2. Cut it and paste it where you want it. The preview redraws as you go.
  3. To take a section off the page without losing it, wrap it in an HTML comment rather than deleting it. It stays in the template and prints nothing.
Tidy the indentation first

Press the wand (Shift+Alt+F) before you start moving blocks around. Consistent indentation makes it obvious where each section begins and ends, which is most of the job.

Drop in a ready-made highlight block

The Blocks tab in the tools sidebar — its tooltip reads ready-made conditional sections — inserts finished, print-safe blocks at your cursor so you don't have to write them. There are four:

BlockWhat it does
Multi-quantity highlightColour-codes lines by how many units were ordered — tiers 2 through 5, each with its own colour picker.
Pickup bannerAppears only on pickup / click-and-collect orders.
Address-warning bannerLists the address problems found on the order.
Conditional (if flag…)A general wrapper — you pick the flag from a list.

Show a block only for one destination

Every address on a document — shipping, billing, store, supplier, warehouse — offers two conditional entries marked with an if tag: Is Country … (conditional) and Is State/Province … (conditional).

  1. Click the entry. A ready-made block is inserted using an example code (NZ for country, ACT for state). The tooltip reads Inserts an example — change NZ to the code you want to match.

  2. Replace the example with the code you need.

  3. Put the content that should print only for that destination between the tags:

    {{#shipping_address.is_country.NZ}}
    <p>GST is included in the prices shown.</p>
    {{/shipping_address.is_country.NZ}}
  4. For "everywhere else", use the inverted form:

    {{^shipping_address.is_country.NZ}}
    <p>Prices exclude local taxes and duties.</p>
    {{/shipping_address.is_country.NZ}}

Only the record's own code is ever true, so exactly one branch prints. Use the short code (NZ, AU, ACT, CA), not the full country name — upper or lower case both work.

This is how you produce a New Zealand-only compliance note, a state-specific returns address, or tax wording for one country. It's also the only value-based test the template language has.

Three or more destinations

There's no "otherwise if". To cover three destinations you write three separate blocks, one per code — plus, for a catch-all, an inverted block for each code you already handled, nested inside one another. That gets unwieldy fast.

Beyond two or three destinations, print one general notice for everyone and keep only the genuinely destination-specific line inside a conditional.

Country and state are independent tests: matching a state says nothing about the country. A state code that exists in more than one country needs both blocks nested.

Work directly in the code

Switch the left pane to Code Editor and you get the template's markup with line numbers, with placeholders colour-coded so ordinary fields, ready-made blocks, repeating sections and comments are easy to tell apart.

  • Typing an opening brace pops up the placeholders available for this template. Picking a repeating section drops in the opening and closing tags together.
  • The wand button (or Shift+Alt+F) tidies the indentation without changing anything the reader sees — useful when you're hunting a missing closing tag.
  • unsaved appears beside it whenever you have changes that aren't saved yet.

Next steps

Last verified: