Anchor links to another page* frustrating*

OK. I know this has been spoken about before and I have read the posts.

But is there a way to make this work?

I have:


<li><a title="Forest Tree" href="">Forest Development</a></li>


with my ...#FD anchor in place on my home page.

Then on the next page I have a long page with anchors next to all the h2 headings like so:

<h2><a name="FD"></a>Forest Development</h2>
<p>Duis autem vel eum iriure dolor in ...</p>

But this isn't working at all.

Has anybody managed to make this work by hook or by crook, because I would like to know...

I have managed to make this work on three pages but there is one page that is doing my head in. It just won't work. It is the first link in the nav and I have tried everything.

Such a simple thing is driving me nuts...


View Replies:
s2d replied on at Permalink Reply
I can certainly sympathize, Nige... those little things you've done a hundred times and expected to take 5 minutes to do can sometimes end up eating your lunch!

I can't see precisely what the problem is, but maybe a few questions will help narrow things down a bit. When you say is doesn't work, does it just do nothing when you click on it, or does it go to the other page, but not to where the anchor is?

Your code looks exactly like the code I have from working examples from a couple of my sites:

The hyperlink:
<p><a title="Hospitals and Specialists" href="">Hospitals and Specialists</a></p>

The anchor:
<p><a name="hospitals"></a> ...text content... </p>

The only difference I can see is that your hyperlink is in a list item, which shouldn't make any difference, but maybe one thing you can try just for kicks is to move your hyperlink to other locations in your page and see if you notice any change in the behavior of the hyperlink. If not, that's one more thing you've ruled out. If you do notice a change, maybe the problem is with the context of the hyperlink, rather than the hyperlink itself.

agedman replied on at Permalink Reply
When you hover over that link does it show correctly something like: ?

Maybe try clearing the cache (server and browser) if you haven't already... And just to be sure, you could run your page through an HTML validator.
nige replied on at Permalink Reply 1 Attachment
Site is here and thanks for your help –

The really frustrating thing is that from four columns of links three columns work correctly. Its the first column that doesn't (see image)

I have tried to eliminate the potential problems but the code is identical. The other column anchors move the page as much as the length of the page allows which is correct, while this first column the links do work, they go to the page, but the anchors just don't work. The page loads exactly the same top to bottom each time.

When I hover over the link it shows the alt tag. It would be helpful to show the link. I suppose I could firebug that.

I appreciate your help on such a frustrating time wasting thing.

Fernandos replied on at Permalink Reply

I'd check for unclosed tags first. If I were you. You've 22 Errors on your page and 1 Warning!

Click this link to verify and fix the bugs.
Your question is unrelated to concrete5 itself, it's more a basic html question.
nige replied on at Permalink Reply
oh oops, OK I'll do that...

Thanks for checking that btw...

I've just checked it and I can't make sense of it mainly because it says there are mistakes that aren't there.

There are no unclosed tags for instance or styles used in the head or end tags omitted. I always fond this validator gives me a headache.

Nevertheless thanks for trying I'm going through everything with a fine tooth comb now...
Shotster replied on at Permalink Reply

A cursory look at your site reveals that the links in the first column don't appear to be the canonical URLs. In other words, when I click the link that says... redirects to...

The links in the other columns appear to be the canonical URL. I would therefore change the links in the first column thusly...

Hope that makes sense,

nige replied on at Permalink Reply 1 Attachment
Yes Steve, thanks for replying and just as I saw your email I discovered that it is an url problem. I have noticed (see shot) that under properties there was an additional page url.

I don't know why, perhaps because there is a redirect to 1st link in nav above this page.

Anyway I removed this additional url and all is working.

I have learn't how to troubleshoot this sort of thing much better so thanks for everyones help!

Shotster replied on at Permalink Reply
Strictly speaking, I suppose this could be considered a bug (or at the very least an oversight) in C5. When accessing a page from anything but the canonical URL, it apparently doesn't parse the URL looking for the hash symbol. Instead, it just ignores it and throws it away before redirecting. C5 could certainly be smarter and preserve any anchors appearing in the URL.

I think it's worthy of a bug report if you want to take the time to do so.

nige replied on at Permalink Reply
I'm not sure about that because my technical knowledge is limited and I don't really understand why it's a bug.

I understand what your saying but why c5 is doing it I don't.

I mean was it my fault there was an extra url in the Additional Page Urls section.

I didn't put it there it was an automatic thing. Why?

Nevermind I prefer to have a few more facts before I cry BUG!

(Its a swear word around here)...

Thanks for the help :-)
Shotster replied on at Permalink Reply
Here's what I suspect happened...

The forest-tree page was initially created under the home page. At that point its canonical URL was "/forest-tree". Then it was later moved underneath the "/what-we-do" page. When that happened, the canonical URL became "/what-we-do/forest-tree" and C5 automatically changed the original "/forest-tree" URL into an "additional" URL.

In other words, C5 did the sensible thing of enabling the previous URL to continue to work. If C5 didn't do that, then if someone had bookmarked the page at its original URL, that URL would no longer work after the page was moved.

By way of overview... In C5, each page has only one canonical URL, but you can create as many "additional" URLs as you'd like. (I do it all the time.) In the case of restructuring the page hierarchy (reorganizing the site map), C5 automatically creates an additional URL for you so that the page continues to be accessible from its previous URL[s]. (A page accessed from an "additional" URL causes [by design] a redirect to the canonical URL. It just so happens that C5 is ignoring anchors in additional URLs.)

Therefore, I maintain that the behavior you encountered - i.e. C5 ignoring anchors in "additional" URLs - is in fact a bug. The good news is that it's probably simple to fix.

I'll go ahead an submit a bug report on it.

nige replied on at Permalink Reply
you just explained it perfectly and I understand exactly.

Yes it is a bug... brilliant.

spenderg replied on at Permalink Reply
Has anyone discovered a workaround to this? I'm using C5 5.5.1 and apparently this is still not fixed. Anchor tags -- a fundamental component of most websites. My users are annoyed to say the least, and I don't blame them. I've tried switching from pretty/non-pretty urls, but nothing seems to help. I can manually type the anchor into the browser address and the anchor works; but doesn't work if I just click on the anchored link within the page.

UPDATE: when editing my block/content, I've edited the HTML directory so that instead of the code the C5 auto creates for anchors, e.g.


I changed it to

href="./#foo" and that worked.