Master templates
Master templates are very useful for maintaining the code for a template's header and footer in one place. Often, master templates are used to display a logo above a report or email or at the bottom of an email to display the festival details of the upcoming edition and links to social media. In addition, master templates provide consistency in the design of reports by including CSS that is then used for all templates. A report's print date can also be included in a footer. In a master template, the placeholder {{ Contents }} is mandatory. This placeholder is replaced by the code of the report or email that uses this master template. You can additionally use the following placeholders: {{ DocumentCreatedBy }} and {{ DocumentCreatedOn }}.
Creating and editing master templates
In the Settings menu, choose the option: master templates. Click an existing master template to open its map, or click the plus button to create a new master template. When creating a new master template, you can choose whether it is intended for emails or reports. From the header in the template map, you can click on the pencil to edit the template's code. This will open the template editor. You can preview your code using the 'Refresh preview' button in the header. This will replace the placeholders with fake data.
Using master templates
Open the editor of a template. At the top of the header it is possible to choose a master template that you want to apply for this template.
Code examples
Master template for email
<style>
* {
font-family: Arial;
font-size: 12px;
}
</style>
<header style="margin-top: 10px; margin-bottom: 10px;">
<img src="https://www.fiona-festival.com/wp-content/uploads/2020/09/Fiona-contact.png" style="width: 275px; height: 150px; align: center; padding: 10px;"/>
</header>
<body style="padding 10px;">
{{ Contents }}
</body>
<footer style="margin-top: 20px;">
With kind regards,<br/>
<br/>
The Festival<br/>
{{ DocumentCreatedBy }}<br/>
</footer>Master template for report
<header style="margin-top: 10px; margin-bottom: 10px;">
<img src="https://www.fiona-festival.com/wp-content/uploads/2020/09/Fiona-contact.png" style="width: 275px; height: 150px; align: center; padding: 10px;"/>
</header>
<body style="padding 10px;">
{{ Contents }}
</body>
<footer style="margin-top: 20px;">
This document was printed on {{format_value DocumentCreatedOn 'd MMMM yyyy - HH:mm' }}
</footer>