RapidWeaver FAQ - Anchors

On one of my pages I would like to add a page-internal link. A link to a spot on the same page. How can I do that in RapidWeaver?
Those links are called anchors.
CHAPTER 1: What is an Anchor?
CHAPTER 2: How can I add Anchors to RapidWeaver?
CHAPTER 3: How can I add “Back to the top” links in RapidWeaver?
CHAPTER 4: Linking to a specific part of the page from another page
CHAPTER 1: What is an Anchor?
An anchor is a link which points to a part of the same page the link is added to.
Let’s make an example:
Say you have a page which is full of text and divided in chapters. You want to have an index of the chapters at the top of the page and when someone clicks on a link in that chapter index you want him to be taken directly to the chapter he wanted to read. How can you afford that? That’s what anchors are good for... Try it by clicking on this link which will take you straight to Chapter 3
CHAPTER 2: How can I add Anchors to RapidWeaver?
That’s how you do it:
1. Write the content of the page you want to have Anchors in
2. Now we will make the index of the page. With index I mean the list of all the sections/chapters on the page. This index will be made of links. So if someone clicks on them he will be taken to the part of the page which is of interest. That’s how to do it:
<a href=#label>Name of the link to the section (ex. Title of the Chapter)</a>
<a href=#1>your text (ex. Chapter 1)</a>
for section 1<a href=#2>Chapter 2</a>
for section 2<a href=#3>Chapter 3</a>
for section 3and so on...
3. Where the chapter starts, thus where you want people to be pointed to from the index, near the title of the section or chapter write
<a name=label></a>
<a name=1></a>
for section 1<a name=2></a>
for section 2<a name=3></a>
for section 3and so on...
Of course you can also name the anchors (“label”) using whatever you like. I used 1 2 3 in the example to make it easier. Just don’t use special characters like à è ä ! ? and replace spaces using underscore _ instead (ex.
<a name=Chapter_3></a>
)CHAPTER 3: How can I add “Back to the top” links in RapidWeaver?
Especially when pages are long it is recommended to add a link which goes back to the top so that people don’t have to scroll the whole way up. To add a “Back to the top” link in RapidWeaver add the following code at the top of the page (first line).
<a name=top></a>
and where you want the link to display add
<a href=#top>Back to the top</a>
you can also add it more than once on the same page if you want to.
CHAPTER 4: Linking to a specific part of the page from another page
To link to a specific part of the page from another page use an external hyperlink like this:
http://urlofthepage#nameoftheanchor
Example: http://rapidweaverfaq.org/site/anchors.html#Chapter_3
RapidWeaverFAQ.org - Tutorials, Tips & Tricks is made with RapidWeaver and for RapidWeaver.
It’s presented by Cédric and hosted by HostExcellence.com
I would like you to give me feedback on this page by commenting in the appropriate section of the Forum. Tell me if it's been helpful. If it wasn’t please tell me why. If you think something is missing please tell me what. If you have questions about it post them there and I will probably try to give you an answer.
Thank you for visiting and supporting my website.
- Cédric -