#1 Edited by Trylks (825 posts) -

In many places, like for instance forum threads, there are links <a href="blah"> that include a hash part specification.

That is all good if you don't forget putting the corresponding anchors. It's not so hard, in the same place where you have <a href="blah"> all you need to put is <a href="blah" anchor="blah">

Take this as an example, here: http://www.giantbomb.com/forums/general-discussion-30/about-female-protagonists-1427109/#26

You have:

<div> <a href="/forums/general-discussion-30/about-female-protagonists-1427109/#26">#26</a> Posted by <a href="/profile/trylks/">Trylks</a> (741 posts) - 25 days, 17 hours ago </div>

Having instead this:

<div> <a id="26" href="/forums/general-discussion-30/about-female-protagonists-1427109/#26" >#26</a> Posted by <a href="/profile/trylks/">Trylks</a> (741 posts) - 25 days, 17 hours ago </div>

Would fix the problem.

That's a little piece of html that would be really simple to produce and it would be really helpful, please add it.

#2 Posted by LordAndrew (13990 posts) -

It is not intended to link to an anchor. It's just a simple way of tracking whether the thread has new posts since you last read it.

#3 Edited by Trylks (825 posts) -

a) It's a link, it's intended to be an anchor. You click on it and nothing happens, it's a broken anchor.

b) If it wasn't intended to be an anchor, it should be an anchor, because that's very useful (and really simple).

#4 Posted by Bollard (5028 posts) -

@lordandrew: On the old site those links used to actually take you to the post (it was super useful when you got a PM reply and didn't have to go hunting for it). It's like how the "Go to last post of a thread" button is now broken. It used to just take you to the first page however, at least it now opens the last page. Doesn't scroll you to the reply box though.

Online
#5 Posted by LordAndrew (13990 posts) -
@trylks said:

a) It's a link, it's intended to be an anchor. You click on it and nothing happens, it's a broken anchor.

b) If it wasn't intended to be an anchor, it should be an anchor, because that's very useful (and really simple).

It's "broken" on purpose. It's a technique Giant Bomb employs to style links differently depending on whether or not new posts have been added since you last visited the thread.

It actually wouldn't be useful if it worked the way you want, because that would skip the first post and other posts and provide no context. That would really suck.

@lordandrew: On the old site those links used to actually take you to the post (it was super useful when you got a PM reply and didn't have to go hunting for it). It's like how the "Go to last post of a thread" button is now broken. It used to just take you to the first page however, at least it now opens the last page. Doesn't scroll you to the reply box though.

The anchor for the reply box is still there (try http://www.giantbomb.com/forums/bug-reporting-33/ids-in-links-1430379/#reply), they're just not linking to it any more. That's an easy fix. But it was never linked in the main link to the thread, only for the last page link. I did not claim that this behaviour was identical to the old site. I had no reason to discuss that feature at all, because it wasn't mentioned in this thread until you brought it up.

#6 Edited by Bollard (5028 posts) -
Online
#7 Edited by Trylks (825 posts) -

Then it's wrong on purpose, but still wrong, the technique you mention is not a technique but an anti-pattern, html should never be used for styling, css is there for that.

If it worked as I say still my opinion is that it wouldn't suck but be useful. Because it's not true the context would be lost, it would still be there, like in any other use of an anchor. Anchors don't eliminate any content or context, anchors simply make easier to find the part that you are searching for. Private message notifications do actually remove the context, are you implying that they should be removed or that they suck?

#8 Posted by LordAndrew (13990 posts) -

Straw man arguments are an anti-pattern. Your PM notification argument is so far from anything I've said that I have no way to respond to it. It makes no sense.

I'm not saying the hash method is the best way to do it, but that's the way it's been implemented. It's done in lieu of a better way.

Context would be lost because you'd no longer be able to see the first post. It would jump directly to what might as well be a random post. So let's say I click the IDs in links! link in the forum feed for the first time and I'm immediately brought to the sixth post in the thread as the hash indicates.

@trylks said:

Then it's wrong on purpose, but still wrong, the technique you mention is not a technique but an anti-pattern, html should never be used for styling, css is there for that.

If it worked as I say still my opinion is that it wouldn't suck but be useful. Because it's not true the context would be lost, it would still be there, like in any other use of an anchor. Anchors don't eliminate any content or context, anchors simply make easier to find the part that you are searching for. Private message notifications do actually remove the context, are you implying that they should be removed or that they suck?

You're clearly responding to something, but I have no context unless I scroll back to the top. If I click the double chevron, then yes I should go to the last post. But not if I'm clicking the main link.

#9 Edited by Trylks (825 posts) -

So let's say I click the IDs in links! link in the forum feed for the first time and I'm immediately brought to the sixth post in the thread as the hash indicates.

Well, there is the straw man, that's not what I'm saying, at all. I didn't want to do this but now it seems necessary:

It's "broken" on purpose. It's a technique Giant Bomb employs to style links differently depending on whether or not new posts have been added since you last visited the thread.

Styling is done through CSS, not "broken" anchors, that's not a technique, that's simply doing things in a wrong way. Now I see what you mean, though, links in the boards change as new posts are added. So actually giantbomb is not styling links differently, but it is letting the browser to style them according to the rules the browser has (helped by a:visited, of course). It would be (still horrible but) much nicer to nest two <a> elements so that the inner element is the one inheriting the style from the outside one (for styling reasons) while it points all the time to the first post, the right place. The styling would work (in a horrible way) and the anchors would work too. Obviously classes for both elements should be different.

It actually wouldn't be useful if it worked the way you want, because that would skip the first post and other posts and provide no context. That would really suck.

Anchors never eliminate any context, private messages do eliminate context, for comparison purposes. Anchors only provide focus and are always optional, the URL without any hash part specification is still there to be used. That's the way anchors are meant to work.

#10 Posted by LordAndrew (13990 posts) -

I don't understand what you're saying about private messages and will not continue a discussion based around the topic until you explain.

Yes, Giant Bomb is letting the browser style the links rather than styling the links itself. That is the entire point. It's why the site is doing it. Sorry for not using your preferred terminology I guess. Your suggested method, if indeed that's a real suggestion, sound way worse. Nested links? Is that even possible?

The real solution is for the site to actually track each user's read status for every thread. Any other solution is a hack, period.

#11 Edited by Trylks (825 posts) -

Anchors don't eliminate context, the context is right there, around the focused element. Private messages notify about a specific post and the rest of the context is gone in them. That's the difference between eliminating context and not eliminating context.

About the "hacking" of the solution. I agree, the current way the site is configured is a hack, the right way would be to track the user's status read. Now, if you want to save that bandwidth by using a hack, I propose a hack that allows that and also using anchors properly.

PD: yes, nesting <a> elements is not possible, I didn't see that coming, I even think I've done that in the past but I may be wrong.

There are other workarounds, though, like breaking anchors with something like #p31 and then using normal anchors without the 'p'.

#12 Edited by LordAndrew (13990 posts) -

With reply PMs, typically the person replying quotes your post. That gives you context. If not, hopefully you remember the post. If you don't remember, then yeah the context is missing and you'll need to reread the thread until it comes back to you. But that doesn't happen that often because people usually quote you. When you're viewing a topic for the first time, you don't have that luxury.

For getting the last post, there's already a link to get you to the last page. And if it ever gets changed back to the old behaviour it will bring you directly to the reply box. Once you're there the last post is just a quick scroll away.

Does the fragment identifier really have to match a named anchor? Sometimes it's used for other purposes, like playing a YouTube video from a specific time. I can't find documentation defining its proper behaviour and use, so I have no idea whether Giant Bomb's use is really wrong or just atypical. Do you happen to know where I might find this?

#13 Posted by Trylks (825 posts) -

Sure:

http://en.wikipedia.org/wiki/Fragment_identifier

http://tools.ietf.org/html/rfc3986#section-3.5

Notice how the fragment is specified in the second link and how convenient that is.

Now, I'm specially proud of this comment I did:

http://www.giantbomb.com/forums/general-discussion-30/about-female-protagonists-1427109/#26

So I think it would be useful, as opposed to what you said here.

PD: also (BTW) name would work replacing id, that doesn't make any difference.

http://stackoverflow.com/questions/484719/html-anchors-with-name-or-id

#14 Posted by LordAndrew (13990 posts) -

I've read both of those. The RFC seems intentionally nonspecific because URIs can be used for a variety of protocols. Is there an HTTP-specific document detailing the fragment identifier? I'm still unconvinced that this is truly important.

There are already post IDs in the page you can use to make that sort of link. And looking at the source to find it...

It appears I've been misunderstanding what you meant from the beginning. You're talking about the numbered link at the top left of each post? Yeah, that should link to the post.

#15 Edited by Trylks (825 posts) -

In HTTP the URI must not include a fragment, that is independent of HTTP:

http://tools.ietf.org/html/rfc2616#section-14.36

http://blog.httpwatch.com/2011/03/01/6-things-you-should-know-about-fragment-urls/

The fragments are specified for URIs as used in HTTP:

http://tools.ietf.org/html/rfc2616#section-5.1.2

And also for URLs:

http://www.ietf.org/rfc/rfc1808.txt

Obviously the same happens in youtube videos, they anchor to a fragment of the current document, which happens to be a video, so they "take you" to that specific instant in the video, as anchors in web pages take users to that place in the page.

I can't seem to find the IDs that you mention, could you paste a working link with that fragment specified?

I don't see the point in making working anchors invisible (in the rendered HTML) and broken anchors visible, I'd suggest to do it the other way around.

PD: Also, I forgot to search at w3.org, you may also be interested on this:

http://www.w3.org/TR/url/

http://www.w3.org/TR/media-frags/#naming-time

http://www.w3.org/TR/WD-html40-970708/htmlweb.html#h-4.1.1

#17 Edited by Trylks (825 posts) -

Great, I hadn't seen those, that means that there is an even better and easier solution. Instead having this:

<div> <a href="/forums/general-discussion-30/about-female-protagonists-1427109/#26">#26</a> Posted by <a href="/profile/trylks/">Trylks</a> (741 posts) - 25 days, 17 hours ago </div>

It would be enough to simply change that with this:

<div> <a href="/forums/general-discussion-30/about-female-protagonists-1427109/#js-message-26">#26</a> Posted by <a href="/profile/trylks/">Trylks</a> (741 posts) - 25 days, 17 hours ago </div>

It may still be interesting to switch the way both fragments are written to keep URLs more elegant, but that would work in terms of features, elegant URLs is a different matter.

#18 Edited by Trylks (825 posts) -

Is there any chance hrefs will be set in those links properly? Or will this be ignored and forgotten as if it never happened?

#19 Edited by alexisg (372 posts) -

@trylks: So the issue as it stands right now, and its on my list of "things that bug me like crazy but someone needs to devote some serious time into it" is that we use axax style commenting. This means that the entire page does not refresh when you click to the next page. So basically only the the first 50 posts would be able to be anchored to right now. There are ways around this but we need someone to devote some time on it. I'd rather keep the ajax style commenting so that people can continue to watch videos and comment at the same time. The forums and comments use the same technology. This allows us to keep things consistent and also make sure you can do all the fancy things you can do with the editor. So basically we gain a ton of awesomeness from one thing but it breaks another thing.

Staff
#20 Posted by Trylks (825 posts) -

I was referring only to forum posts and in general the places where the html code for the number of comment is inserted, right here I am writing the comment #20 (and I didn't count them one by one). As I can read #20 I would like also to be able to right click and copy link address of that #20, which would be thus: #20.

This fragment for the url could be more nicely named than including js-message, I'd strip that and leave only #20 and for the links in the board I'd use something longer than that, one single character is enough, but you can go corporatist and use #gb20 or anything of your preference. But then again, this is about elegance and aesthetics, features and pragmatism work in either case.

#21 Edited by Trylks (825 posts) -