1.6

Table Of Contents
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.
When a snippet is added to different sections or contexts, it is displayed according to the
section's or context's stylesheet. This means that the same content can appear differently
depending on the styles applied to the section or context, but it still has the exact same
contents.
Adding a snippet
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453.
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 the
next page).
To add the snippet to the content of a section, drag the snippet from the Snippets folder on the
Resources pane to the desired location in a section.
Check the option Insert as shared content to insert a reference to the original snippet in the
template, rather than a copy of the original snippet. When a snippet is being used as shared
content, the contents of the snippet itself are not added to the page. Modifying the snippet on
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543.
Page 464