betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

25 May 2006

Technorati Tags working with COREBlog Categories

Making links to categories valid for tags

Currently when I look at my Technorati profile, I see my "Top Tags" listed as stupid stuff like "categorylist_html?cat_id=2"... which is the result of me trying to use the COREBlog category links for Technorati tagging. As described in the Using Technorati Tags page, all one has to do is insert rel="tag" into the link and link to any web page where the URL ends in that tag. Normal COREBlog category links end in "categorylist_html?cat_id=#" which gives those stupid tags. Now I fixed that for me, so hopefully my stuff will be properly tagged in Technorati soon...

What I did is make a little Python Script that allows me to put the name of the tag last in the URL, e.g. /...somepath.../athens - see the current links to the categories for an example. This works using traverse_subpath and redirecting to the proper category page. There are only a few changes to make in the ZMI. Operation for users should stay pretty much the same. The redirect isn't the most pretty solution (a redirect is always more load on the server and more delay for the user), but on a normal small blog this shouldn't matter too much.

Another solution I implemented is Luistxo's description to put Technorati tags into your COREBlog's RSS feeds. With both of these, I'll have to wait and see if it works.

Now for the code, we need a new "Script (Python)" in our COREBlog contents. Paste this code in there:

url = context.blogurl()
if len(traverse_subpath) == 2:
    category_name = traverse_subpath[1]
    category_id = traverse_subpath[0]
    url = url + '/categorylist_html?cat_id=' + category_id
return context.REQUEST.RESPONSE.redirect(url)

Next we change one single line in the entry_body dtml-method (which lives in COREBlogs contents in the ZMI as well. Change this line:

<a href="<dtml-var blogurl missing="">/categorylist_html?cat_id=<dtml-var id>" rel="tag">[<dtml-var name missing="category name is missing">]</a> 
To look like this:
<a href="<dtml-var blogurl missing="">/categoryname/<dtml-var id>/<dtml-var name missing="none">" rel="tag">[<dtml-var name missing="category name is missing">]</a> 
That should do the trick. Use at your own risk, your mileage may vary, etc. etc.

Posted by betabug at 12:24 | Comments (0) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< Burning Chrome | Main | Winter-Traum, Sommer-Temperaturen >>
There are no comments.
You can trackback to:
There are no trackbacks.