9. Phrase level elements10. Links (19/20)11. Other features

10. Links

The Link "Add link" toolbar button may be used to add a link —a ref or ptr element— to your document.

When you use any of the "Add link" menu entries, you'll be automatically prompted to specify the value of the target attribute.

If, after that, you want to change the link target, you may of course use the Attributes tool just like for any other attribute. However it's more convenient to right-click the ref or ptr element and select entry "Set Link Target" from the contextual menu.

Figure 10-1. The contextual menu displayed by right-clicking a link (below it's just a "???" placeholder because the link target has not yet been specified)
The contextual menu displayed by right-clicking a link

This menu entry displays a dialog box implementing auto-completion. First type "#" in the text field to delete the initial "???" placeholder and thus, list all possible link targets.

Figure 10-2. The dialog box used to set the target of a link
The dialog box used to set the target of a link

An internal link uses syntax "#ID_OF_TARGET_ELEMENT" for the value of its target attribute. Example: "#ch1", where "ch1" is the xml:id of the first div of the document being edited. Auto-completion works great for internal links. The above dialog box automatically lists all the possible target values.

An external link typically starts with "http://" or "https://" (e.g. "https://tei-c.org/"). You can also use the above dialog box to type the URL of an external link, but of course, in this case, auto-completion will not be active.

9. Phrase level elements10. Links (19/20)11. Other features