Blogger Hacks, Categories, Tips & Tricks

Thursday, August 10, 2006
Default Markup for Post Contents, Anyone?
Turns out that the barrier keeping Adi's ajax-powered backlink previews from working across blogging platforms is the lack of a consistent markup for post content. So here's a request for all platform administrators, blogging software designers and template designers. Let's wrap your platform's version of the <$blogitembody$> tag in a unique class to make it easy to find. A quick survey of the folks in the know (Stephen) indicates that the required class would be


If all of the <$blogitembody$> tags in Blogger, as well as equivalent tags in Moveable Type, Live Journal, Typepad, Wordpress etc were defined by this class, then the ajax preview of backlinks would be able to grab the data that is required, and previews would be available for backlinks from multiple sources. This modification strikes me as an excellent example of the need for interoperability and consistency between platforms. Let's see whether we can effect a change!

See Also: Ajaxified Display of Internal Backlinks

Filed in: , ,
Posted at 8:09 AM by John.
<    >
Blogger Ramani said...
Yes, John. It's high time that we improve the consistency of blog templates. Not just the post contents, post title, post footer, comment contents etc should also be identified by unique class names. My archive browser hack was made possible only by identifying class names but it doesn't work with all templates due to lack of consistency :(

<    >
Blogger Johan Sundström said...
I would suggest basing a standard upon an already common practice rather than inventing a new one, guaranteed not to be used by anyone, except any explicit adopters.

Today, the Blogger template defacto standard for where to find the blog post content is in a div whose class attribute contains the word "post", in some form (or, in XPath terms, //div[contains(@class,'post')]).

In practice, this particularly fits three very (and possibly evan most) common variants on the theme, class="post-body", class="post" and class="post three", and given how CSS works, it would be a lot of work for blog authors to change the class attribute not to include any other names but "entry-content".

My (Hoodwink druid's) tip, thus: lax it to contain post in the class attribute, and regarding the implementation, prefer a div that contains post-body over other candidates, and one that has this as a separate word over any other candidates.

Links to this post:

Create a Link

eXTReMe Tracker