Linking main navigation to a particular part of a page


(Lang) #1

I have looked at a few discussions about anchor links but still can’t get this to work -

I want a main navigation link to take the viewer to a particular part of a page.

I have placed an anchor link at the target point on that page. The anchor link is this: < a name =“test” >< / a > (I have placed spaces in this anchor link otherwise it doesn’t sho up on this page)

I have tried using the ‘offsite page’ to do this using the url of the target page appended with .html#test but to no avail.

the url I am using for the offsite page is http://www.actorclivefrancis.com/theatre.html#test
(the word ‘theatre’ is the page name).

Wondering what I’m doing wrong here.


(Mathew Mitchell) #2

Let’s forget navigation menus for the moment and just try to get the link correct. Your link above does not work. If I use:
http://www.actorclivefrancis.com/theatre#test

That will take me to a page, but only to the top. What am I supposed to be seeing when I get to that page? (Presumably something further down the page.)


(Lang) #3

Yes, something a long way down, another heading in fact - THEATRE 1985-2012

Thanks for your attention Matthew


(Mathew Mitchell) #4

Hmm . . . I don’t see any anchor placed on that page near Theatre 1985-2012. Are you sure you created one? A general HTML form for an anchor is:

<h2 id="contactinfo">Contact Information</h2>

Notice that “id” portion of the HTML.

You can create an anchor using Markdown, or HTML, or using Joe Workman’s helpful Link & Anchor. If you are new to web design then I highly suggest using Joe’s stack for this:
https://joeworkman.net/rapidweaver/stacks/link-anchor/


(Lang) #5

The anchor link is just above THEATRE 1985-2012

I just deleted it and re-entered and published it just to make sure.


(Lang) #6

I have now just placed it on the same line as the heading. Hope you can find it there.


(Oscar Schmid) #7

The anchor must be written like this. No blank spaces. That works!
<a name =“test”></a>


(Oscar Schmid) #8

When you set the anchor at the bottom of the page, there must be a space under the anchor.
The link to the anchor always leads to the top of the window.

When there is no content or space further down the anchor/page, the browser can not pull up the window.


(Lang) #9

I have placed that anchor link < a name =“test” >< / a > (minus all the spaces) at the target destination.
I have also placed some content below that anchor as you suggest Oscar

Below is the link in my 'offsite page" url window:
http://actorclivefrancis.com/theatre.html#test

If I click my navigation link (which is the offsite page) THEATRE 1985-2012 it still gives me a 404-not found. I must be overlooking something here.

Perhaps I should resort to simply creating a new page instead of trying to link navigation to part of a page.

Thanks all for trying to help.


(Oscar Schmid) #10

The offsite page link should be with http://www
In your link there is no www… and in one link (theatre 1965-80) there is a folder theatre/(index.html not visible)
In the link to Theatre 1985-2012 there is no folder theatre and you link to a page called theatre.html#test.

The link in the offsite page must correspond exactly.

Perhaps http://www.actorclivefrancis.com/theatre/#test
or
http://www.actorclivefrancis.com/theatre/index.html#test


(Mathew Mitchell) #11

@Lang You are not using the correct link. As I mentioned earlier you can simply use:
http://www.actorclivefrancis.com/theatre

If you are using an anchor called “test” then use this:
http://www.actorclivefrancis.com/theatre#test

The problem as I see it is you seemed to have removed the 1985-2012 header. Don’t know why this happened. At any rate it’s hard to check when the relevant header is no longer visible.

You seem to be using a stack by DooBox to create your headers. This should not be the source of the problem, but it’s possible there is some conflict. However, hard to know that for sure until other possibilities have been eliminated.

My guess is, all things considered, that created a new page is the better way for you to go. You already have a lot of “stuff” on the theatre page: so dividing it up across 2-3 pages is probably a very good idea.


(Lang) #12

Thank you Oscar, I will try out these various permutations.


(Lang) #13

Thanks for your input Mathew. Much appreciated.


(Lang) #14

I’ll close this topic now. Thanks again for your assistance Matthew and Oscar.