Subtemplates



This function is only available for "classic" templates. You can find more information here.

Introduction

In primedocs a large number of different file types can be stored as templates. One of the main strengths of primedocs is the management of Microsoft Office file formats and especially Word resp. the Open XML for Word Processing format.

If a template is created in primedocs and a document is generated from it, the complete content including header and footer is inserted as a single section.

NOTE

Thanks to the primedocs inheritance system, it is possible to control the complete header or footer via one Word template, in order for the corresponding information to be managed centrally in the template types intended for this purpose

However, if you want to insert different sections, e.g. to implement different portrait/landscape formats or different headers and footers, the subtemplates are required.


Structure

A subtemplate has the same structure as a normal template. It uses the same inheritance mechanism, however, you cannot directly attach document functions to a subtemplate. Required data from document functions, e.g. profile data, must be added via the corresponding content template. Linking between subtemplates and content templates is done via the template editor:

Link types

primedocs knows two different link types for subtemplates:

  • "On document generation": these subtemplates are automatically inserted in the corresponding order when the document is generated. A condition can be specified additionally, so that e.g. depending on the option in the document parameter a subtemplate is added or not.

  • "Optional": These subtemplates are available in the generated document in the primedocs ribbon using the button "Additional content".

Each content template can be linked to multiple subtemplates, whereby a subtemplate always corresponds to a separate section. To create a subtemplate, a normal Word template must be created and marked as "subtemplate".

IMPORTANT
Once a template has been marked as "subtemplate", this cannot be undone!


Document functions

In order to use data from document functions, such as profile data, it must be ensured that the document function "Profile data" is attached to the content template. When the subtemplate's template editor is opened afterwards, its Word editor can be opened by selecting a content template:


Conditions

The template editor can also be used to link subtemplates that are only integrated if a corresponding condition is met. This requires the condition to be formulated in JavaScript. Data from the Document Parameter can be queried via an API so that, for example, a checkbox can be placed in the document parameter. Only if the checkbox is active, a specific subdocument will be inserted.


Document generation process

The subtemplates system complements the existing primedocs document pipeline:

 

PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland