Anchor links to another page* frustrating*
But is there a way to make this work?
<li><a title="Forest Tree" href="http://dev.touch-akl.com/talltrees/index.php?cID=58#FD">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...
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:
<p><a title="Hospitals and Specialists" href="http://rotarysunshineproject.org/content/index.php?cID=67#hospitals">Hospitals and Specialists</a></p>
<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.
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.
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.
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.
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...
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...
...it 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,
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!
I think it's worthy of a bug report if you want to take the time to do so.
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 :-)
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.
Yes it is a bug... brilliant.
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.