2021.2

Table Of Contents
The Media (virtual stationery) is included in the output - it is printed on the page's background -
, according to a setting in the Output Creation Presets.
Styling is done via style sheets (see "Local formatting versus style sheets" on page745). The
style rules are in the context_print_styles.css file. Note how they combine the HTML tag, ID and
class of elements to select them. (See also: "Selectors in Connect" on page898.)
Scripts
Scripts personalize content. Most of the scipts in the Information folder (on the Scripts pane)
are made with the Text Script Wizard (see "Using the Text Script Wizard" on page808).
Tip
Hover over the name of a script in the Scripts pane to highlight parts of the template that
are affected by the script.
Text that should be replaced by data is not only surrounded by @ (e.g. @date@) but also
wrapped in a span (see "Span" on page699). Each span has an ID, or a class if the same text
occurs more than once, to use that as the selector of the script. The selector of the Invoice Total
script, for instance, is a class: .inv-total.
Wrapping elements in a box (see "Boxes" on page696) or in a semantic HTML element makes
it easier to target them in a script or in a style sheet. Place the cursor in the element or select
multiple elements. Then, on the menu, click Insert > Wrap in Box. You can now use the
wrapper element as a script's or style's selector; see "Using the Text Script Wizard" on
page808 and "Styling and formatting" on page745.
The Text Script Wizard has an Expand button that opens the Script Editor, where you can edit
the code or add your own. (For an introduction, see "Writing your own scripts" on page877).
When you double-click on the Invoice Meta script, the Script Editor opens immediately. This
script shows how to add data using the replace() method (see
https://www.w3schools.com/jsref/jsref_replace.asp).
Note that this is a native JavaScript function. Functions that are only available in Designer
scripts are listed in the "Designer Script API" on page1281.
Page 163