TEMPLATES

Template Syntax

13min

Target Audience

The target audience of this document are developers or persons with at least some software development experience.

Template Engine

We are using Pebble Templates to populate email and document templates with data. Please be aware that we are still using version 3.0.4 of Pebble Templattes, because some of our custom extions are not yet compatible with the latest version of Pebble.

Important Blocks

Loops

Text


If Blocks

Text


Important Modifiers

trim

Text


numberformat

By default a decimal point number will be printed with maximum precission - in some cases you might want to use a custom format.

Formatting a number as integer

Text


Formatting a number with exactly two decimal points and a local specific thousand separator

Text


nl2br

Sometimes you might encounter a multi-line string, where the lines are separated by a newline-character. When you want to render such a string within an HTML template (keeping the line breaks) you have to convert the newline characters to HTML br (line break) elements.

Text


Custom Macros

Gender specific text

Text


Currency format

Text


Custom Extensions

In certain situations the WYIWYG template editor would remove (or complain about) invalid markup - e.g. when wrapping loops or if conditions around table cells or table rows. In such cases you can add the for or if condition directly onto the HTML element as an attribute.

h-for Attribute

Text


h-if

Text