2019.1

Table Of Contents
Finally, Post Pagination Scripts run, in the order in which they appear in the Scripts pane
(see "Post Pagination Scripts" on page843).
Post Pagination Scripts are run in a Print context after the content has been paginated.
Because they can search through the output of all Print sections, and modify Print sections (one
at a time), they may be used to create a Table Of Contents (TOC), as explained in the topic:
"Creating a Table Of Contents" on page845.
Note
Any JavaScript files included in a section run after the scripts in the Scripts pane.
Selectors in Connect
Selectors are patterns used to select one or more HTML elements. They were originally
developed to be able to define the layout of web pages without touching their content, through
Cascading Style Sheets (CSS). In Connect, since each section in a Connect template is in fact
an HTML file (see "Editing HTML" on page609), the very same selectors can be used in style
sheets (see "Styling templates with CSS files" on page718) and template scripts (see
"Personalizing content" on page761 and "Writing your own scripts" on page798). Using
selectors for scripting can increase the speed with which a template and data are merged; see
"Use an ID as selector" on page812.
Standard CSS selectors
l Selectors are made up of one or more of the following components:
l
An HTML element. Type the HTML tag without the angle brackets (e.g. p) to select all
elements of that type (pselects all paragraphs).
l
A class. Type the class name, preceded by a dot, e.g.: .green, to select HTML elements
with that class.
l
An ID. Type the ID, preceded by #, e.g.: #intro, to select an HTML element with that ID.
l
An attribute of an HTML element. Type the attribute and, optionally, its value, between
square brackets, e.g.: [target], to select HTML elements with a matching attribute.
l
A pseudo-class. For example, tr:nth-child(even) selects all even table rows.
These components can be combined in different ways. For example, p div selects all
paragraphs inside <div> elements, while p, div selects all paragraphs and all <div> elements.
Page 822