2019.2

Table Of Contents
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 page853.
For an example in which JSON snippets are being used to localize a template, see this how-to:
Localizing templates using json.
Adding a snippet to the Resources
Before adding a snippet:
l Import the resource files that are related to the snippet, such as image files and CSS files,
into the template file. Drag and drop the files to the corresponding folders (Images and
Stylesheets, respectively) on the Resources pane. If you want to use external images,
see "Images" on page724.
l
Drag the snippet itself to the Snippets folder on the Resources pane, or create a new
snippet from an existing piece of content in the template (see "Creating a snippet" on
page740).
Remote snippets
A remote snippet is an HTML file that is not located within your template file but is hosted on a
Content Management System or other external location.
Page 738