2018.1

Table Of Contents
Changing attributes via script
Many attributes can be changed via the user interface. Another way to change attributes is by
using a script.
Any of the Script Wizards can produce a script that changes an attribute of an HTML element.
Set the Options in the Script Wizard to Attribute, to output the script's results to the value of a
specific attribute. See "Using the Text Script Wizard" on page671.
In code, you can change an element's attribute using the function attr(); see "Writing your own
scripts" on page689 and "Designer Script API" on page1021.
Inserting an element
To insert an element in a section:
1. Navigate to where you want to insert the element, using the arrow keys, the mouse, the
Breadcrumbs (see "Selecting an element" on the facing page) or the Outline pane.
2.
Click the respective toolbar button. Alternatively, click the element on the Insert menu.
3. Add an ID and/or a class. ID's and classes are particularly useful with regard to variable
data (see "Personalizing Content" on page656) and styling (see "Styling templates with
CSS files" on page616).
4.
Use the Location drop-down (if available) to select where to insert the element.
l
At cursor position inserts it where the cursor is located in the template.
l
Before element inserts it before the HTML element in which the cursor is currently
located. For example if the cursor is within a paragraph, the insertion point will be
before the <p> tag.*
l
After start tag inserts it within the current HTML element, at the beginning, just after
the start tag.*
l
Before end tag inserts it within the current HTML element, at the end, just before
the end tag.*
l
After element inserts it after the element in which the cursor is currently located. For
example if the cursor is within a paragraph, the insertion point will be after the end
tag of the paragraph (</p>).*
Page 525