Saturday, February 3, 2007

Post Update Trick

My Recent Posts Widget now and then leads to discussions with other Bloggers about the order in which recent posts appear. Updated posts appear at the top of the recent posts list, even if their publishdate is somewhere far in the past. From a technical point of view, this is quite logic: people subscribe to a feed to be informed about changes in the blog, so if an old post is updated, it should appear in the feed immediately. But many times changes are just cosmetic: correcting a typo, repairing a dead link, or assigning a new label. In that case, appearance of the post in the feed is a little bit annoying or confusing.

Some readers suggested that I should change the coding of the widget, and leave out updated posts. I think that is not a very good idea, because an updated post could contain relevant new information. So I came up with an interesting trick.

Add the following styling definition to your blog's template:

.updateinfo { display:none; }

Now, whenever you update a post, at the beginning of the post insert update-information, using the following html:

<span class="updateinfo">UPDATE: Repaired some dead links. Content has not be changed.</span>

If you publish your post, the update info will not be displayed on your blogpage, but the feed, and therefor also the Recent Posts Widget, will show the update-text.

Friday, February 2, 2007

Recent Comments Widget Updated

Following up on a bug report from Molly I updated the Recent Comments Widget. It now supports both Full and Short feed settings.
If you have installed the widget, you don't have to do anything, it will just keep working. Thanks Molly!

Saturday, January 27, 2007

New Blogger Template - The Hobbit

Last week I discovered a very beautiful webdesign, and I decided to port it to a Blogger Template.


Get it now!

If you want to discuss this template, please visit the Beautiful Beta Forum.

Thursday, January 25, 2007

Playing with the Feed Links

Now and then one of your questions triggers my own curiousity. Shrish asked how to hide the Feed Link at the bottom of the frontpage, while keeping the Feed Link at each postpage. And how to change the text of the link. Well, here is how it is done. A new hack.

Step 1: Backup your template.
Better be safe than sorry.

Step 2: Edit you template
Open your template in HTML-mode, and search for the includable with the id feedLinksBody. You have to add some lines of code to it to make the hack work. Below, you will find the code of the includable, the new lines are marked in red.

<b:includable id='feedLinksBody' var='links'>
  <b:if cond='data:blog.pageType == "item"'>
    <div class='feed-links'>
    <data:feedLinksMsg/>
    <b:loop values='data:links' var='f'>
       <a class='feed-link' expr:href='data:f.url' expr:type='data:f.mimeType' target='_blank'><data:f.name/> (<data:f.feedType/>)</a>
    </b:loop>
    </div>
  </b:if>
</b:includable>

Adding these 2 lines of code makes the Feed Link only show up on an Item Page, and not on the Main Page or an Archive Page.

If you want to change the text of the Feed Link from "Subscribe to:" into something else, you have to replace <data:feedLinksMsg/> with your own text.
The same can be done with the "Post Comments" text, and with the "(Atom)" text.
Just replace <data:f.name/> and <data:f.feedType/> respectively with your own text (or remove them completely).