How to create and use anchors

Best Practices > Step 4 - Pages >

How to create and use anchors

Previous pageReturn to chapter overviewNext page
Show/Hide hidden text

An anchor is a reference to identify the position of an object in a page: they are used to set up links directly to the object from any other point in the website.

There are no limits to the number of anchors you can add to a page: theoretically, there is one anchor per object. To simplify your work, you are advised to place an anchor on an object only when this is strictly necessary, and give anchors names by which you can identify them easily.

Click to expand/collapseHow to create internal links to pages using the anchors

It's often useful to set up links which highlight particular elements when scrolling the page: you may want to write a short summary at the beginning of a page with links that take the visitor directly to the paragraph that interests him.

Click to expand/collapse

In Step 4 - Pages create the pages, inserting all the objects you need to complete the page contents: insert a text object at the beginning for your summary, and then other text objects for each paragraph to create a link to.
In the page layout table, select the Text Object for the first paragraph and click on the button to give it an anchor: give the anchor a name in the window that opens.
Do the same for each Text Object  you have inserted, making sure the anchor names are clear.
Double-click on the Text Object of the opening summary, to open it in the editor.  
Select the first item in the summary and click on the button to open the Link window: select the WebSite Page option and use the button to display the website Map and select the page to work on. Click on the Internal Page Anchor field to display all the anchors available and select the one that identifies the contents in the summary item.
Repeat this operation for all the other summary items you want to create a link for.

You can improve navigation for visitors by adding a link at the bottom of each paragraph that takes them back to the top of the page:

With the button, add an anchor to the  Text Object that corresponds to the initial summary.
Open the Text Object in the editor to edit the first paragraph and add a caption such as " Back to top" at the bottom of it.
Select the "Back to top" item and click on the button to create a link with the page, making sure that you indicate the anchor associated with the summary.
Repeat the operation to add the "Back to top" item at the bottom of each paragraph.

Instead of the "Back to top" item, you could use a button or add an image in the Text Object, or use an Image Object (in this case, you can use the mouseover effect): in any case, the procedure for creating the link is the same.

Click to expand/collapseHow to manually create and manage anchors

If you need to place an anchor inside a text, and not at the beginning, for example next to a paragraph of a Text Object, you can do so in two ways:

1. Split the original Text Object into two separate text objects, and you will place the anchor on the second one.
2. Manually create an anchor in the Text Object.
Open the Text Object in the editor and click on the button to activate HTML code recognition.
Move the cursor to where you want to place the anchor and type <A NAME="anchor_name">&nbsp; </A>

Obviously, "anchor_name" in this example would be replaced by the name that you really want to give to the anchor. In the example, "&nbsp;" means that a blank space will be added after the <anchor_name> tag so that the name you give is clear.

When you create a link to an anchor you must remember that manually-created anchors are not included in the list shown by the Internal Page Anchor option. So you must proceed as follows:

In the Link window, select File or URL.
In the Internet file field, type #anchor_name where you type the name you really want to see in place of anchor_name.