VodooMerge Logo
  • Demo
  • Template Design
  • API

Microsoft Word or LibreOffice Writer templates

Both Microsoft Word and LibreOffice Writer are supported as software for template creation. Compatibility with templates created in other software is not guaranteed.

Template should be designed and saved as an ordinary .docx document.
For all dynamic data and templating commands it is highly advised to use MergeField, proper template processing is not guaranteed otherwise.
To add new MergeField command to the document:

  • Click where you want to place a MergeField.
  • In the Insert tab, click Quick Parts and then Field.
    Responsive image
  • Under Field names, select MergeField.
    Responsive image
  • Type your command under Field properties > Field name, press Ok button

Example templates with Velocity syntax: sample_employees.docx, sample_weekly.docx

Template should be designed and saved as an .odt document.
For all dynamic data and templating commands it is highly advised to use Input field, proper template processing is not guaranteed otherwise.
To add new Input field command to the document:

  • Click where you want to place a Input field.
  • Click Insert, click Field and then More Fields (or Ctrl+F2).
    Responsive image
  • Select Functions tab, then select Input field under Type and press Insert.
    Responsive image
  • Write your command into big input box and click Ok.
    Responsive image

Example templates with Velocity syntax: sample_employees.odt, sample_weekly.odt

Templating language

Velocity is used as template processor, for more details, please consult the Velocity user guide.

  • To print a value, use: $VARIABLE_NAME.
    For example, to print title:
    $title
  • For conditional output, use (#if(CONDITION) #else #end).
    For example, to print title1 if flag variable is set to true and - otherwise:
    #if($flag) $title #else - #end
  • Use loops to output arrays/lists: (#foreach($ELEMENT_NAME in $ELEMENTS_ARRAY_NAME) #end).
    For example, to print lastName of every Customer in customers array:
    #foreach($customer in $customers) $customer.lastName #end
  • Tables work a bit different. You want to output table rows, but it's not possible to add commands in-between rows in MS Word or LibreOffice Writer.
    To handle tables, two suffixes are provided:
    @<, if added to the command anywhere inside a table row, will have this command interpreted as if it were set before the row.
    @> is the exact opposite suffix, which will have a command interpreted as if it were placed after the row.
    For example, to print firstName and lastName of every Person in the persons array, each pair in a new row:
    Responsive image
  • Demo
  • Template Design
  • API
Contact: hello@insign.ch

© 2021 by insign | All rights reserved