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.
-
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.
-
Set the image layout to In line with text (right-click → Wrap Text → In Line with Text). Floating images can break loops.
-
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} -
Upload the template. The placeholder is replaced with the product image.
Excel works the same way as Word: insert a placeholder image, and put the tag in the image’s alternative text (right-click → Edit Alt Text).
In HTML templates, put the tag directly in the src attribute of an <img> element:
<img src="{d.form_submissions[0].form.data.elements[label='Robot'].options[0].image}" style="width: 120px; height: auto;">Fitting the image
In Word, imageFit controls how the product image is sized within the placeholder:
| Tag | Behaviour |
|---|---|
{…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:
| Image | Product |
|---|---|
(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)}Your company logo
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.
Links
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}Insert a hyperlink and enter the path as the address without curly braces:
d.form_submissions[0].form.data.elements[label='Robot'].options[0].image<a href="{d.form_submissions[0].form.data.elements[label='Robot'].options[0].image}">View product image</a><a href="mailto:{d.user.email}">{d.user.name}</a>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)}Put the tag in the src attribute of an <img> element:
<img src="{d.id:barcode(qrcode)}" width="120" height="120">Common barcode types:
| Type | Use for |
|---|---|
qrcode | Quote numbers, links, any text |
code128 | Article numbers and general-purpose barcodes |
ean13 / ean8 | Retail product codes (EAN) |
datamatrix | Small 2D codes for labels |
pdf417 | Documents 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)}| Option | Description |
|---|---|
width, height | Size in millimetres. |
scale | Scale factor from 1 to 10. |
includetext | true to print the value below the barcode. |
textsize | Size of the printed text. |
rotate | N (normal), R (right), L (left) or I (inverted). |
barcolor, textcolor, backgroundcolor | Colours as hex codes, for example #1F2933. |
eclevel | QR code error correction: L, M, Q or H. |
svg | true 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.
| Scope | Colours |
|---|---|
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:
| Option | Price |
|---|---|
{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>