Thursday 26 September 2013

How to link from one part of a page to another part of the same page in RapidWeaver

How to link from one part of a page to another part of the same page in RapidWeaver

Making a link that jumps to a different place on the same webpage

To jump from one part of a page to another, you need two things; a bit of code that forms the link, and another bit of code that is at the destination of the jump. So, in the part of the page you want to be the jump link, you put: <a href="#destination">Jump to destination</a>
That will give you a link that looks like this:

Jump to destination  

And at the place you want to jump to, you’ll put this code: <a name="destination"></a>
I’ve put that last bit of code right at the bottom of this long page of gibberish; if you click the “Jump to destination” link above, you’ll see it work. I’ve also put a “pagetop” link at the bottom, which will bring you back to the beginning of this article.

Important:

When you’ve entered the code in the places you want it, be sure to select each piece of code and go to the Format menu and choose “Ignore Formatting”. This tells RapidWeaver not to display the code as it is written, but to execute it like the HTML it is.

I’ve used arbitrary names above; you can actually use any name you like, providing the link name has a hash in front of it and the destination name is the same. So you could call it “pagebottom” instead of “destination”, and then your code will look like this:

<a href="#pagebottom">Jump to bottom of page</a> and the code you’d put right at the bottom of the page would be: <a name="pagebottom"></a>

Note too that where it says “Jump to bottom of page”, that is how the link will actually appear on the page. You can change this to whatever you like, providing the link and destination code names are the same.