Friday, February 11, 2005

Blogger tip - permalink to post within the archive page

This will be gibberish to anyone who's not a Blogger.com user. Please ignore.

I posted this over in Daniel Conover's comments, then realized it also belonged here.

So that your post's permalink doesn't change if you go back and retitle the post:

---------------
Added Feb. 12:
To try to clarify:
With Blogger (the blogging tool), when you publish a post, it's put up on the web on 2 weblog pages - a standalone page, which just contains that post and any comments on it, and a monthly (or weekly or daily) archive page that shows the post (but no comments) "in context" with all the other posts from that time period. By default, Blogger
a) makes the post's permalink point to the "standalone" page,
and
b) names that page, in part, from the post's title. So if you subsequently modify the post by changing its title, anyone trying to reach it via the old "permalink" (which includes the pagename) is out of luck.

What I'm showing here is how to change your weblog template so that your post's permalink points inside the "archive" page instead of pointing to the "standalone" page.

Previous "Blogger tips" posts for changing your template:
---------------

First save your template so you can restore it if this doesn't work, then in place of

<$BlogItemBody$>
<br><span class="byline">posted by <$BlogItemAuthorNickname$> at <a href="<$BlogItemPermalinkURL$>"><$BlogItemDateTime$></a>

try
<$BlogItemBody$>
<br><span class="byline">posted by <$BlogItemAuthorNickname$> at <$BlogItemDateTime$> [<a href="<$BlogItemArchiveFileName$>#<$BlogItemNumber$>" title="Permalink (within page)">Link</a>]

and, of course, preview and make sure it works before saving the change.

There is still be room for improvement; someone can still go astray by linking to the "standalone" (single-post-on-single-page) post (which, if you have comments enabled, will be the page that shows the comments); but it's less likely.

No comments: