In this article, we will take a look at some advanced settings for custom templates for exporting documents. If you don’t know what a custom template is and how to create it, check out our detailed article.
Here we're going to show you some special tips and tricks. We'll focus on how to modify a template to make it more sophisticated.
Image
The tag for an image starts with the % sign, e.g., for an Account, it is {%logo}.
To change the size of the inserted image, you can add the parameter size
.
{%image | size:70:70}
This means the image will be 70px x 70px.
Condition
The condition allows you to mark parts of the text to be added to the exported document only if it is also filled in in Raynet. For example, the Note field in a Quote will only appear in the document if it is filled in.
The list of available conditions can be found in the parameters for the specific record type. Each condition is defined by an opening and closing tag. The name of the opening tag is followed by a hash # and the closing tag is followed by a slash /, e.g., {#birthday} ... {/birthday}. For each value, there is a parameter with the prefix has, which can be used to test whether the value is filled in {#hasBirthday} ... {/hasBirthday}.
Filling out a condition can then look like this:
Conditions always start with the # symbol and end with a slash /:
{#hasBirthday}Birthday: {birthday}{/hasBirthday}
Ending a condition can be done in two ways:
{#items.length > 3}...{/items.length > 3} {#items.length > 3}...{/}
Operators that can be used in conditions:
!== not equal {#discount !== "0,00"}... {/} === equal {#discount === "0,00"}... {/} > greater than {#items.length > 1}... {/} < less than {#items.length < 1}... {/} <= less than or equal {#items.length <= 1}... {/} >= greater than or equal {#items.length >= 1}... {/} && AND {#items.length > 1 && discount === "0,00" }... {/} || OR {#items.length > 1 || discount === "0,00" }... {/} ! NOT {#!hasDescription }... {/}
You can use the condition for the number of items for e.g., a Quote, Sales Order or Deal.
{#items.length > 3} more than 3 items {/} {#items.length <= 3} 3 or less items {/}
Cycle
Row numbering in a cycle is achieved in the following way:
{#products} {$rowNum}. {name} {/}
Condition row numbers
Row numbers can also be used in a condition:
{#products} {#$rowNum < 5}{name}{/} {/}
(only the first 5 products will be shown).