PDA

View Full Version : anchor links problem


gilbert
Mar-04-2007, 08:24 PM
Is there a problem with anchor links or am I missing something??

I am trying to link from one help page to a second page that has several bits of info...so the anchor links will take you right to the spot for that section without having to scroll through...

I have searched and even re-checked this link that is posted:

http://jennyc.smugmug.com/gallery/1003113

BUT, that page appears to have the same problem I am having...Try clicking a link (that should be taking you to another spot etc) and you go nowhere...but the address says this "URL/1/" before the anchor name (URL used in place of whole address, it doesn't actual put those letters there!)...Is it converting the # to that? Why? How do you fix this?

I have tried a bunch of things myself but I do not know why it changes your anchor to that URL/1/ANCHOR bit...

EDIT: It also seems to be stripped from another page I had anchors that said "back to top" where the target was on that page and it just jumped up to that anchor (top).

So why is SM stripping the anchors? How can you set them up now??

EDIT 2: Sorry for the multiple edits but I am searching online to see what I can do...It appears when you type in the anchor for the page (when on the target page add the #anchorname) it does take you to that spot...so why won't the link part work??

Is this something in the Java? if (window.location.href.split("#")[1]

gilbert
Mar-05-2007, 10:15 AM
bump...anyone?

the SM help page uses an anchor to go from "help ordering-buying prints" page to "minimum requirements" (near mid-bottom of a new page)...why won't this work on my site (and that other one I put in the first post)?

Andy
Mar-05-2007, 10:17 AM
bump...anyone?

the SM help page uses an anchor to go from "help ordering-buying prints" page to "minimum requirements" (near mid-bottom of a new page)...why won't this work on my site (and that other one I put in the first post)?
Hi, it's only been 90 mins, and I'm still finding the person who could answer you, thanks for your patience :)

Andy
Mar-05-2007, 10:21 AM
Hi,

Are you surrounding all your html with <html> and </html>

?

gilbert
Mar-05-2007, 10:39 AM
Hi Andy,

You can see I posted last night, so I was bumping it from that, not from today.

Yes, all of the html is in tags...but I will go check again if you think that is the problem...but like I mentioned, it has stopped working on a page that previously had no problems (yes that has html tags too). Links within the page to say "back to top"...now those do not work at all and the new page will not let me link from one page to another (different spots as anchors on that page).

I will try shortening the html and testing it on another page to see if it is that html code on the target page.

Andy
Mar-05-2007, 10:50 AM
Hi Andy,

You can see I posted last night, so I was bumping it from that, not from today.
Hah - reading is hard (my bad!) I read the time wrong - NO worries at all :D

Yes, all of the html is in tags...but I will go check again if you think that is the problem...but like I mentioned, it has stopped working on a page that previously had no problems (yes that has html tags too). Links within the page to say "back to top"...now those do not work at all and the new page will not let me link from one page to another (different spots as anchors on that page).

I will try shortening the html and testing it on another page to see if it is that html code on the target page.it may be changed internally - I'll run this by {JT} and see what he says.

{JT}
Mar-05-2007, 11:20 AM
We do auto convert links that have hash marks in them and you are going to a gallery that is not smugmug ajax style. What is the original link you are trying to post that gets auto-converted? Your example above does not contain a hash mark - so it would fail the test and not be converted.

gilbert
Mar-05-2007, 11:35 AM
We do auto convert links that have hash marks in them and you are going to a gallery that is not smugmug ajax style. What is the original link you are trying to post that gets auto-converted? Your example above does not contain a hash mark - so it would fail the test and not be converted.
Hi,

I have no idea what that means! SM ajax? Here is my testing setup (produces same problem)...

I tested it and it still does not work... The link within the same page ("top") seems to work, so I can go look at that old page to see if that can be fixed. Something happened to it since I created it, because it did not work when I checked yesterday...I will go back to the code to see if something was stripped there. The problem of the linking between pages is shown here on my sample pages. I posted that bit of Java in the first part of the thread...related to problem?

Here is what I have set up to show the problem. Hope this is clear...
This (http://gilbertphotos.smugmug.com/gallery/2547008) is the main page that contains a link to the target page. It says "to get to my anchor click here"

The target page, here (http://gilbertphotos.smugmug.com/gallery/2547083), contains the anchor reference from the main page, and a link within the same page to go to the top of the page.

password: testhtml (for both)

Here is the html put in the descriptions...it is a lot of sample text.

main page html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>main test html page</title>
</head>
<body>
Here is some sample text.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
TO GET TO MY TEST ANCHOR CLICK <a href="http://gilbertphotos.smugmug.com/gallery/2547083#testanchor">HERE</a>.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.
</body>
</html>

target page html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>target page</title>
</head>
<body>
<a name="top"></a>THIS IS THE TOP OF THE PAGE. Here is some sample text. <br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br /><br />

MY ANCHOR LINK IS CALLED TEST ANCHOR AND IT IS <a name="testanchor">HERE</a>.<br /><br />

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam lectus justo, porttitor ac, ullamcorper ac, cursus in, ante. Duis mi ante, sodales in, auctor vel, vehicula eget, sapien. Proin iaculis dui vitae leo. Integer blandit tempus leo. Morbi turpis. Suspendisse turpis. Nulla eget leo. Cras interdum sollicitudin ante. Sed placerat scelerisque magna. Vestibulum rutrum nibh a eros. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque nonummy, lorem non elementum consequat, velit diam iaculis erat, eget venenatis neque dui sed ligula.<br />
THIS IS AN ANCHOR WITHIN THE SAME PAGE. TO RETURN TO THE TOP OF THE PAGE CLICK <a href="#top">HERE</a>.
</body>
</html>

Andy
Mar-05-2007, 12:32 PM
Hi, we've bugged this in our bug-tracker for {JT} to fix. Can't say when it will be fixed, but it will be fixed!

Thanks for bringing it up, and so carefully explaining it :bow

gilbert
Mar-05-2007, 02:59 PM
Hi, we've bugged this in our bug-tracker for {JT} to fix. Can't say when it will be fixed, but it will be fixed!

Thanks for bringing it up, and so carefully explaining it :bow

Thanks Andy...now I feel special...I'm glad it wasn't just me...I was staring at the html for SOOO long last night trying to figure out what I was missing. When I checked that other site (jennyc) I realized it might not be me!

In case it got lost in the long bit...It seemed to work (on the test page) for anchors within the same page, but it does change the URL when it is linked from one page to a target on another page. That bit of Java seemed to have something to do with it (from my searching etc)...I know nothing of Java so that's where I hit the wall...

How would I find out when it is fixed? Is there a page that tells us of "bug" fixes that are completed? (sorry if that is an easy one...I never needed to keep an eye on any other issues)

Thanks (to {JT} too!) :wink

Andy
Apr-26-2007, 08:52 PM
Thanks Andy...now I feel special...I'm glad it wasn't just me...I was staring at the html for SOOO long last night trying to figure out what I was missing. When I checked that other site (jennyc) I realized it might not be me!

In case it got lost in the long bit...It seemed to work (on the test page) for anchors within the same page, but it does change the URL when it is linked from one page to a target on another page. That bit of Java seemed to have something to do with it (from my searching etc)...I know nothing of Java so that's where I hit the wall...

How would I find out when it is fixed? Is there a page that tells us of "bug" fixes that are completed? (sorry if that is an easy one...I never needed to keep an eye on any other issues)

Thanks (to {JT} too!) :wink


http://cmac.smugmug.com/photos/131481087-S.jpgWeb Super Hero {JT} fixed this tonight :clap :clap :clap

DrDavid
Mar-09-2009, 08:49 AM
http://cmac.smugmug.com/photos/131481087-S.jpgWeb Super Hero {JT} fixed this tonight :clap :clap :clap
Looks like this has been broken again :(

on this site: http://daraghkennedy.smugmug.com/gallery/6901190_CFd2a

I've created anchors like:

<a name="cards"></a>

then, in the menu, I link to:

http://daraghkennedy.smugmug.com/gallery/6901190_CFd2a#cards

But, SmugMug re-writes it as:

http://daraghkennedy.smugmug.com/gallery/6901190_CFd2a/1/cards

and it doesn't go to the anchor link.

Can you take another look and see if you can fix it? :)

Thanks!

David

DrDavid
Mar-10-2009, 08:07 PM
bump

jfriend
Mar-10-2009, 08:47 PM
Looks like this has been broken again :(

on this site: http://daraghkennedy.smugmug.com/gallery/6901190_CFd2a

I've created anchors like:

<a name="cards"></a>

then, in the menu, I link to:

http://daraghkennedy.smugmug.com/gallery/6901190_CFd2a#cards

But, SmugMug re-writes it as:

http://daraghkennedy.smugmug.com/gallery/6901190_CFd2a/1/cards

and it doesn't go to the anchor link.

Can you take another look and see if you can fix it? :)

Thanks!

DavidThis has been busted for awhile. I tried to use anchor names a few months ago and had the same problem. Smugmug steals them and you can't use them in your page.

Tinkersdamn
Jul-31-2009, 04:26 PM
I ran into this same problem and was happy to find it so well documented but disappointed to learn that it is still not corrected.

Can we get an update on this problem with named anchors please? TIA

A short summary of the problem -


An href link to a named anchor (e.g. <a name= "foo">Foo</a> on the same page/gallery works just fine.
When attempting to link to the very same anchor from another page using standard href synax (e.g. <a href= (page path)#foo>FooBar</a>) you get to the target page but NOT the anchor location within the page.
It is also clear that the passed in URI (absolute or relative) is being mangled and replaced with a URI that has the hash mark removed (among other things) So the questions are; Is this still acknowledged as a problem? Is there and ETA for a solution? And finally, is there a workaround that we can use today?

Thanks for the help.

Paul (Tink)