Blosxom Tags

I've been using tags here right from the beginning, because they provide a much more powerful and flexible way of categorising content than do simpler more static categories. This seems to be pretty much the consensus in the blogosphere now.

I started off using xtaran's tagging plugin. The one thing I didn't like about tagging was that it has a fairly brute-force approach to doing tag filtering - it basically just iterates over the set of candidate files and opens up and checks them all, every time.

So I started messing around with adding some kind of tag cache to tagging, so that the set of tags on a post could be captured when a post was created or updated, and thereafter tag filtering could be done by just referencing the tag cache. That means that if you've got 100 posts, your tag query only needs to read one file - the tag cache - instead of all 100 posts.

En route I realised I really wanted a more modular approach to tagging than the tagging plugin uses as well. For instance, I'm experimenting with various kinds of data blogging, like using dedicated special-purpose blogs for recording bookmarks or books or photos. And for some of these blogs I wanted to be able to do basic tagging and querying, but didn't need fancier interface stuff like tagclouds.

So I've ended up creating a small set of blosxom plugins that provide most of the functionality of tagging using a tag cache. The plugins are:

  • tags - provides base tag functionality, including checking for new and updated stories, maintaining the tag cache, and providing tag-based filtering. Requires my metamail plugin.

  • storytags - provides a story level $storytags::taglist variable containing a formatted list of tags, suitable for inclusion in a story template. Requires tags.

  • tagcloud - provides a $tagcloud::cloud variable containing a formatted wikipedia:"tagcloud" of tags and counts, suitable for inclusion in a template somewhere. Requires a hashref of tags and counts, which tags provides, but should be able to work with other plugins.

Note that these plugins are typically less featureful than the tagging plugin, and that tagging includes functionality (related tag functionality, in particular) not provided by any of these plugins. So tagging is still probably a good choice for many people. Nice to have choice, though, ain't it?

All plugins are available in blosxom sourceforge CVS repository.

blog comments powered by Disqus