2022.1

Table Of Contents
Note
Pay attention to the service's Terms of Service. Many servers have limitations on the
number of calls that can be made to them for free. Beyond these limits, their content will
not show up in your template unless you purchase a business plan.
Step 2: Preparing the template
The next step is to set up a template. If you've got the HTML to embed content in your template
you can paste that HTML on the Source tab (and skip Step 3).
Otherwise your template has to contain an element that can be replaced or followed by the
remote content: an empty paragraph, for example, or a heading. If the element isn't unique in
the template, give the element an ID.
Note that interactive content, such as an interactive map, can only be used in Web templates,
and cannot be output on Print or Email contexts (even though they will show up in Preview
mode!).
Step 3: Writing a script
The final step is to write a script that retrieves the content and inserts it into the template (see
"Writing your own scripts" on page918). Use the element or the ID of the element that you
added in Step 2 as the script's selector. For information about selectors, see "Selectors in
Connect" on page939.
Tip
Select an element, then click on 'ID' in the Attributes pane, to create a script that has that
element's ID as selector.
Retrieving content
Depending on the type of content that the remote server returns - HTML or JSON - you can use
loadhtml(location) or loadjson(location) (see also: "loadhtml()" on page1358 and
"loadjson()" on page1361) to retrieve the content. The link that you selected in Step 1 should
be passed to the function as a string. For example:
Page 949