Word User guide
Welcome! This guide will explain how to set up your Word document, so that it can serve as a template for exporting.
In short, this is what you can do
- Create a new Word file
- Add styling and markup to your Word file, including a header, footer, page numbers and more
- Inside your content, you can make use of Tags, like showing the
${invoice_number}
or${invoice_lines}
- Create a
Word template
in this system, and upload your Word file - You can then export your
Word template
(for example for an Invoice) to Word or PDF, where all the Tags will be replaced - Then optionally you can send this export to the customer
Getting started
This module expects that you will upload .docx
files, as they provide the most (consistent) features.
Definitions
In this guide there will be mentions of tags
, there are 3 types of tags that you can use in your Word document:
- Common tags that will be replaced by a predefined value (text, images, HTML etc.). For example:
${ticket_number}
${ticket_signature}
${PAGE_BREAK}
- Twig (advanced) tags, where you could apply additional formatting or do if statements, loops etc. For example:
{{ticket_date|date("m/d/Y")}}
{% if address_country_code == 'NL' %}Nederland{% endif %}
{% for tag in tags %}
- {{ tag }}{% endfor %}
caution
When using twig inside Word directly, it is recommended to not use tabs/spaces/enters if possible, because these will be visible in the final export, which could be unexpected.
- Block tags (uncommon), where you can define some content that might be cloned (repeated), deleted etc. For example:
${PAYMENT_CONDITION}
This should be deleted if payment condition is not relevant
${/PAYMENT_CONDITION}
${ADDRESS_DATA}
This will be cloned
Multiple times
${/ADDRESS_DATA}
Creating a word template
When you create a new Word template, you will need to select a Resource. The resource determines what tags will be available in your Word file. These tags are pre-defined by the developer.