2018.2

Table Of Contents
var json_data = loadjson("snippets/snippet.json");
results.html(json_data.field1);
See also: "Writing your own scripts" on page722.
For an example in which JSON snippets are being used to localize a template, see this how-to:
Localizing templates using json.
Styling and formatting
In the Designer you have everything at hand to make your templates look good: colors, fonts
and all the tools to position, align and embellish elements in your designs. This topic informs
about the ways to style a template.
Local formatting versus style sheets
There are in general two ways to style elements:
l
Using local formatting. Local formatting means styling an element directly, using a
toolbar button or one of the formatting dialogs.
l
Using Cascading Style Sheets (CSS). Style sheets can determine the appearance of
individual elements, as well as the appearance of elements that have the same class or
HTML tag.
Whether applied through style sheets or through local formatting, behind the scenes all layout
properties in the Designer are CSS properties. When you format an element locally, an inline
style rule is added to the element.
Note that where local formatting conflicts with a formatting rule for the same element in one of
the style sheets, the local formatting rule gets priority; the rule in the style sheet will be ignored.
It is highly recommended to use style sheets in templates right from the start. Even more so if
the communications are going to be output to different output channels, or if they consist of
different sections (for example, a covering letter followed by a policy). Using CSS with
templates allows a consistent look and feel to be applied. A style sheet can change the look of
multiple elements, making it unnecessary to format each and every element in the template,
time and again, when the company's layout preferences change. See "Styling templates with
CSS files" on the facing page.
Page 645