2019.1

Table Of Contents
Translating text
OL Connect templates can be multilingual. For information about multilingual templates and
how to create them, see "Translating templates" on page850.
Snippets
A snippet is a small, ready-to-use piece of content in a file. Snippets can be re-used within the
same template, in all contexts and sections. They can contain any contents that a section can
have, such as text, images, variable data, dynamic tables, etc.
Normally, a snippet is an HTML file, but it can also be a JSON file.
When a snippet is added to different sections or contexts, it is displayed according to the
section's or context's style sheet. This means that the same content can look different
depending on the styles applied to the section or context, without changing the content.
Tip
It is possible to open and edit any HTML or JSON file in the Designer: select File > Open,
select All files (*.*) as the file type and then select a HTML or JSON file.
About JSON Snippets
JSON Snippets are snippets that contain pieces of JSON data instead of HTML. Just like HTML
snippets, JSON snippets are stored in the Snippets folder on the Resources pane, but their
file name should end in '.json'.
JSON Snippets cannot be inserted into the content directly, but they can be accessed via a
script using the loadjson() function:
var json_data = loadjson("snippets/snippet.json");
results.html(json_data.field1);
See also: "Writing your own scripts" on page798.
For an example in which JSON snippets are being used to localize a template, see this how-to:
Localizing templates using json.
Page 713