1.5

Table Of Contents
the page actually modifies the snippet's source. If a snippet is used in multiple locations (such
as different contexts and sections), modifying one instance will modify all of them at once.
It is also possible, and often useful, to insert a snippet or part of it, using a script. See "Loading
a snippet via a script" on page530.
Tip
To export a snippet from your template, drag or copy/paste it out of the Snippets folder to a folder
on the local hard drive.
Creating a snippet
To turn a parts of a letter, email or web page into a snippet for reuse in the content of a
template:
1. Select the part that should be saved in a snippet.
2.
Right-click the selection, point to Snippet and click Create.
3.
Right-click the new snippet on the Resources pane in the Snippets folder and rename it.
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 names should end in '.json'.
JSON Snippets cannot be inserted into the content directly, but they can be accessed via a
script using the function loadjson():
var json_data = loadjson("snippets/snippet.json");
results.html(json_data.field1);
See also: "Writing your own scripts" on page515.
Page 452