RSS

Coding Problems

14 Nov

Some of you may have noticed that the internal anchors on some posts are taking you to the wrong place. If you scroll down to, say, my Rutilius Namatianus post and click on the hyperlink for footnote 1, it takes you to the note in my most recent Medieval Medicine post. I just noticed this and the anchor/destination codes are correct. If this happens and it annoys you (I consider the notes important or I wouldn’t put them in), if you click on the post title and read it as a standalone, they seem to work the way they’re supposed to.

I don’t have time to work on this more right now because I have to go to work. Hopefully this will fix itself. If not, I’ll work on it more this evening. Anyway, I apologize and am aware of it.

EDIT: I’ve done this before – I’m going to need to save each post as a draft, then re-load it to the blog. Those of you receiving this blog through e-mail or RSS notifications might be told I’m making new posts. Again, I apologize. Hopefully these will stay in the correct order.

Second Edit: Tried that, didn’t work. Sorry folks but for the time being people will just have to scroll down to see the correct fn.

Third Edit: Fixed re my comment below. At least for the first page worth of posts – you click on “older posts” and beyond and I make no promises. I swear this hasn’t happened before – just like my UL tag issue with my latest book review.

Advertisements
 
2 Comments

Posted by on November 14, 2011 in Blogology, Books

 

Tags: ,

2 responses to “Coding Problems

  1. Jonathan Jarrett

    November 16, 2011 at 4:05 pm

    The way that these anchors work is to tell the browser to find the corresponding anchor (the part beyond the hash) in the current page. The problem is that that page may be different. So, what is happening here is:(1) you write your posts as single units, with anchors of the form #1, #2 etc.(2) those anchors correctly identify the notes for those entries in draft, because they are each their own page, but(3) when loaded up as part of the main blog, your anchors all look the same to the browser, because a page that was, for example:http://medievalhistorygeek.blogspot.com/2011/11/coding-problems.htmlis now being read as part of the page http://medievalhistorygeek.blogspot.com/. So, (4) when you click any of the anchors, the browser looks for the first instance of #1 etc. and it finds whichever is the first in the whole blog front page, not necessarily the one in the post in which the anchor was clicked.There are two ways to get round this: firstly, somehow find out what your post URL will be (does Blogger do short-links?) and use that to make an absolute reference in the anchor link, rather than the current relative one. So, specify:http://medievalhistorygeek.blogspot.com/2011/11/coding-problems.html#1rather than just #1. This is very fiddly to do so what I do, as you may have spotted, is to run my anchors in a sequence of #a1, #b1 and so on, right up to #zz1 for a total of 52 possible sequences. That way, not only should I never end up with two sets of alike anchors on the front page, it's pretty unlikely that a search of the blog should bring up two posts that share anchors. Not impossible, but unlikely. So I recommend this workaround.

     
  2. Curt Emanuel

    November 16, 2011 at 7:53 pm

    Thanks Jonathan, I appreciate the tip. I'd pretty much figured that was what was going on though I wonder why it hasn't happened before, at least not that I recall and I always check every link, including internal anchors, for viability as soon as I put something up (and usually through "view blog" rather than "view post"). What I'm planning (though I may change to your system after I think on it a bit), since I pretty much never post two footnoted posts on the same day, is start using posting date.Frex, for this one, "#1114111" Where 11-14-11 was the posting date and then run through the sequential numbers. If I do happen to post two footnoted pots in a day I'll just have to remember to make the second one 1a, 2a, etc.I've been debating whether to go back and apply these to my existing posts. I probably will tonight just for what's on the first page right now. Shouldn't take long though I have a book review I really want to finish this evening.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: