Skip to content

Images, Links and Barcodes

Product images

Every option in the configuration can have an image (options[].image). You can place these images in your document, for example in a product overview or a specification page.

In Word, images are added through a placeholder image. The tag goes in the image’s alternative text, not in the document text.

  1. Insert any image where the product image should appear, for example a grey square. Size it to the maximum size the product image may have.

  2. Set the image layout to In line with text (right-click → Wrap Text → In Line with Text). Floating images can break loops.

  3. Right-click the image → View Alt Text (or Edit Alt Text) and enter the tag, for example:

    {d.form_submissions[0].form.data.elements[label='Robot'].options[0].image}
  4. Upload the template. The placeholder is replaced with the product image.

Fitting the image

In Word, imageFit controls how the product image is sized within the placeholder:

TagBehaviour
{…image:imageFit(fillWidth)}Uses the full width of the placeholder and keeps the aspect ratio. This is the default.
{…image:imageFit(contain)}Fits the image inside the placeholder and keeps the aspect ratio. Recommended for product images of different shapes.
{…image:imageFit(fill)}Stretches the image to fill the placeholder exactly.
{d.form_submissions[0].form.data.elements[label='Robot'].options[0].image:imageFit(contain)}

Images in a loop

Put the placeholder image in a table row with a loop to show an image for every selected option. Use a filter to skip options without an image:

ImageProduct
(placeholder image with alt text:) {d.form_submissions[0].form.data.elements[i].options[i, image!=''].image:imageFit(contain)}{d.form_submissions[0].form.data.elements[i].options[i, image!=''].label} {d.form_submissions[0].form.data.elements[i].options[i, image!=''].description:convCRLF}
{d.form_submissions[0].form.data.elements[i].options[i+1, image!='']}
{d.form_submissions[0].form.data.elements[i+1]}

Missing images

When the image URL is empty or invalid, a small placeholder symbol (a square with a cross) is shown. To remove the image instead, add a drop tag to the same alternative text:

{d.form_submissions[0].form.data.elements[label='Robot'].options[0].image:imageFit(contain)}{d.form_submissions[0].form.data.elements[label='Robot'].options[0].image:ifEM():drop(img)}

A logo that is the same on every quote doesn’t need a tag. Insert it in the template as a normal image, for example in the header.

You can make any link in your document dynamic, for example a link to the product image or a product page.

Select the link text, insert a hyperlink (Ctrl+K / Cmd+K) and enter the tag as the address:

{d.form_submissions[0].form.data.elements[label='Robot'].options[0].image}

QR codes and barcodes

Generate a QR code or barcode from any value, for example the quote number or an article number.

Insert a placeholder image and put the tag in its alternative text:

{d.id:barcode(qrcode)}

Common barcode types:

TypeUse for
qrcodeQuote numbers, links, any text
code128Article numbers and general-purpose barcodes
ean13 / ean8Retail product codes (EAN)
datamatrixSmall 2D codes for labels
pdf417Documents and IDs

Add options as a second parameter, separated by commas:

{d.form_submissions[0].form.data.elements[label='Robot'].options[0].slug:barcode(code128, includetext:true, height:12)}
{d.id:barcode(qrcode, eclevel:H, barcolor:#1F2933)}
{d.id:barcode(qrcode, svg:true)}
OptionDescription
width, heightSize in millimetres.
scaleScale factor from 1 to 10.
includetexttrue to print the value below the barcode.
textsizeSize of the printed text.
rotateN (normal), R (right), L (left) or I (inverted).
barcolor, textcolor, backgroundcolorColours as hex codes, for example #1F2933.
eclevelQR code error correction: L, M, Q or H.
svgtrue to generate a sharp vector image, recommended for printing.

Colours

Change the colour of text, a table cell or a row based on the data. The tag prints nothing:

{d.form_submissions[0].form.data.elements[label='Robot'].options[0].price:ifLT(0):show('#C0392B'):elseShow('#1F2933'):color(p)}

This makes the paragraph red when the price is negative.

ScopeColours
color(p)The paragraph text
color(cell, background)The background of the table cell
color(row, background)The background of the table row
color(row, text)The text in the table row

For example, highlight discount lines in a loop:

OptionPrice
{d.form_submissions[0].form.data.elements[i].options[i].label} {d.form_submissions[0].form.data.elements[i].options[i].price:ifLT(0):show('#FDECEA'):elseShow('#FFFFFF'):color(row, background)}{d.form_submissions[0].form.data.elements[i].options[i].price:formatN(2)}
{d.form_submissions[0].form.data.elements[i].options[i+1]}
{d.form_submissions[0].form.data.elements[i+1]}

Colours must be 6-digit hex codes. In HTML templates, use CSS instead: style="color: {d.…}".

Formatted text (HTML content)

If a text field in your data contains HTML, such as <b>, <i>, <ul> or <a>, html renders it as real formatting instead of printing the tags:

{d.extra_fields[0].fields[slug='delivery-conditions'].value:html}

To keep line breaks in plain text and render it as formatted text, convert the line breaks first:

{d.extra_fields[0].fields[slug='delivery-conditions'].value:convCRLF:html}

html works in Word and HTML templates.

Page breaks

Start every product on a new page by adding a page break in a loop. In Word, the easiest way is to enable Page break before on the first paragraph of the repeated block (Paragraph → Line and Page Breaks). This avoids an empty page after the last item.

In HTML templates, use CSS:

<div style="break-before: page;">…</div>