Anchors are a way to put place holders within a document, which in turn allows you to create links to those anchors.
A list of topics at the beginning of an article, that link to each paragraph relating to those topics, is a good example of its use.
In this article we will:
- Learn how to create anchors in a Joomla article. << This has been linked to an anchor in this page.
- Learn how to link to those anchors. << This has been linked to an anchor in this page.
Click the position where you would like the anchor to be (the place you would like to link to) and then click the anchor on the editor above the article text area.
give the anchor a name. In this example (and this document) I have given my first anchor the name creating_anchors. It is best not to use spaces.
This will add a marker by embedding it in the "background". This marker/anchor is not visible when the article displays. But you can (as seen in the picture above) see where the editor has placed an icon of an anchor, to show you that it is there.
Now that we have created the anchor we can create a hyperlink to it. In order to do this we simply highlight the text we wish to click on, and in turn take us to the anchor, then click on the icon of a link in the editor's panel above.
In the below image you can see the highlighted text (which is now clickable in the article you are reading). The dialogue box on the right asks us for a link name. Because we have created an anchor, all we need to do is type a hash and the name we gave the anchor. In this example it is: #creating_anchors.
Because we are linking to an anchor we can ignore the "open in new window" selection and leave it at "not set".
Now if you click save and view the article, you should be able to click on the hyperlinked text, and it will take you to your anchor.