|
A target anchor is a piece of text that is referred to by a link (a source anchor). Before creating a link to such a piece of text, you must first turn it into a target anchor.
Just select a character string with the mouse and choose Create
Target from the Links menu. The selected text is now
a target. If you have set the status "Show targets" to your current Formatted
view, the text will be preceded by an a target
icon . In the Links view,
target icons which identify target anchors are always displayed (there is no
option to show or hide target icons). When a target anchor is created, Amaya
automatically generates the NAME attribute value:
By extracting a word longer than 3 characters from the anchor content
OR
By generating a number.
In both cases, Amaya guarantees that the generated value is unique within the document.
In HTML 4.0, an element can be used as a target of links. A target element is a typed element that has an ID attribute which is referred to by a link (a source anchor). Before creating a link to such an element, you must first turn it into a target element.
You can create a target element in the same way you create a target anchor. Just select a character string within the element, use the Esc (F2 on Windows) key to select the element itself and choose Create Target from the Links menu. The selected element has now an ID attribute, which identifies it as a target element. Amaya automatically generated this unique ID value.
If you have set the status "Show targets" to your current Formatted view ,
the text is preceded by an a target icon .
It's also possible to directly create the ID attribute by using the Attributes menu when the element is selected, or in the Links view or Structure view. When the value has been entered, Amaya checks this value and changes it if it is already used by another NAME or ID attribute in the same document.
Finally, you an also use the Special/Add/Remove IDs menu to automatically add an attribute to all elements of a given name, in the whole document, or within a selection. You just need to type in the element's name and use the Add or Remove buttons to do the operation.. The following figure shows how we use this menu to add an ID attribute to all the P elements in a document. All P elements that already have an ID attribute will be skipped.
To create an anchor that is a link to another document:
To create a link to a particular target anchor or a particular target element in the same document or in another, replace step 3 above by:
The Links menu contains a command that reverses the two commands above: Delete Anchor. Put the selection or the insertion point anywhere within the anchor to be removed (you do not need to select the whole anchor, but you can) and activate the Delete Anchor command. The anchor is removed, but its content remains.
If you want to keep an anchor but to change the target of the corresponding
link, select any part of that anchor or just put the insertion point within
the anchor, and click the
button or choose Change Link from the
Links menu. Then designate the new target of the anchor as
above (step 3 in the creation of a link).
To change the target of a link, you can also edit the href
attribute, either directly in the Structure view or in the Links view or using
the Attributes
menu.