Configuring Printing Template
A Print template is a layout which specifies what and how a metadata information will be printed. The printing template for printing an entry can be freely configured using CSS and Handlebars. This file should be located in the "print/" sub-directory and the file must be named 'print-template.html'. An example of print template is given below.
Print Template Example
<style>
.element {
padding-top: 2.5cm;
padding-bottom: 2.5cm;
padding-left: 2.5cm;
padding-right: 2.5cm;
margin: 0px;
page-break-inside: avoid;
page-break-after: always;
font-size: medium;
}
table.info {
width: 100%;
table-layout: fixed
}
tr {
height: 25px;
}
td {
border: 1px solid gray;
padding-left: 2px;
vertical-align: middle;
}
td.caption {
text-align: center;
}
td.value {
font-weight: bold;
}
div.time {
text-align: right;
}
.logo {
font-size: 70px;
font-style: normal;
font-weight: normal;
color: gray;
text-align: left;
padding-bottom: 25px;
}
</style>
<div class="element">
<div class="logo">Logo</div>
<div>
<table class="info">
<tr>
<td class="caption">Startzeit:</td>
<td class="value" style="text-align: center">{{model.Time_Start}}</td>
<td class="caption">Author:</td>
<td class="value">{{model.News_Author}}</td>
</tr>
<tr>
<td class="caption">Schlagzeile:</td>
<td class="value">{{model.Title}}</td>
<td class="caption">Story / Group:</td>
<td class="value">{{or model.Group.Title model.Story.Title}}</td>
</tr>
</table>
</div>
<div class="time">Audiolänge: {{format-duration model.Time_Duration "HH:mm:ss"}}</div>
{{#if model.RTFContent.ops.length}}
<div class="time">Textlänge: {{format-duration model.Time_TextDuration "HH:mm:ss"}}</div>
{{quill-editor value=model.RTFContent readOnly=true}}
{{/if}}
</div>
which looks like this:
Styling:
CSS can be used for applying colors and styling to the template.
<style>
.root td {
padding: 5px;
}
.root .title {
background-color:gray;
}
</style>
<table class= "root" style="border:1px solid black;">
<tr>
<td>Title</td>
<td class="title">{{model.Title}}</td>
</tr>
</table>
which looks like this:
Page Break:
Add the following code block at the end of the template structure to insert a page break.
<div class="page-break"></div>
Insert RTF Text:
Add the following code block to insert RTF text into the template.
{{quill-editor value=model.RTFContent readOnly=true}}