Folksonomy Update

Posted Sat, 29 Oct 2005

Folksonomy 1.2 is avaialble for download

Folksonomy is a pyBlosxom plugin that infers relationships between your blog entries based on tags; providing links to related stories, links to related tags, a tag cloud, and the ability to search for entries by tag.

What's New: As of Folksonomy 1.2, there are no longer any dependencies on other plugins. Folksonomy is now a complete tagging solution for pyBlosxom. If you're already using Tags or Tag Cloud, simple replace those plugins with Folksonomy, and you'll still have all the same functionality you had before!

Folksonomy Quick Guide:

Configuration

Add the following entries to your config.py:

py['pretext'] = "<div class="tags">Tags:""
py['posttext'] = "</div>"
py['tagsep'] = ", "
#py['tag_url'] = "http://mysite/tags"  # defaults to $base_url/tags
#py['tag_url_display'] = "http://mysite/tags" # defaults to tag_url
#py['ignore_tags'] = []

pretext, posttext and tagsep will be used to render the $tags variable for your story template. tag_url is the base url to search for tagged entries. Links to tags will be to the url: $tag_url/. tag_url_display is useful if you use mod_rewrite (or an equivellant) to hide the actual URL of your tag_url. For instance, my tag_url is http://www.timfanelli.com/blog/tags/, but I use mod_rewrite to make it http://www.timfanelli.com/tags/ instead. tag_url_display effectively overrides my tag_url when generating links (tag_url is still needed for searching though, so don't change it!). Finally, ignore_tags will cause Folksonomy to ignore those specified tags when infering relationships and creating the tag cloud, but you'll still be able to search for entries with those tags.

Install Folksonomy

This parts easy, just copy folksonomy.py to your plugins directory, and enable it in your py['load_plugins'] if necessary. If you already have Tags or Tag Cloud installed, you may uninstall those plugins now.

Tag Your Entries

This part could be, as they say in French, the suck. Especially if you have a lot of entries. Tagging a single entry is very easy, just add a line like the following:

#tags tag1,tag2,tag3

Below your entry title. I've created a little helper script that will tag all your entries based on their category just to get you started (BACK UP FIRST, I TAKE NO RESPONSIBILITY FOR LOST OR DAMAGED CONTENTS). My friend Matt used it successfully though.

Set Up Your Templates

Now that everything's tagged, we need to set up your templates to show all the cool stuff. Starting with your story template:

  • Add $tags to your story, mine is located just underneath the body. This will show the tags for your entry.
  • Add $relatedstories, mine is located at the very bottom of my story template, and I use CSS to make it look nice.
  • Add $relatedtags, I don't show this on my blog because I don't think it adds much value, but it's there if you want to use it.

Then your header or footer template for the tagcloud:

  • Add $tagcloud or $populartagcloud wherever you like, mine is in my side bar defined in my footer template.

$popular tag cloud is a rebalanced subset of your full $tagcloud -- use this if you have a lot of tags with very few entries. It'll help reduce clutter on your page. I'm currently working to enable a URL that will show the full tag cloud for use with this feature.

Voila!

Your blog should now be folksonomy enabled. Easy, right?

Leave Feedback

I'm very excited about how well Folksonomy has been received so far in the pyBlosxom community, and I fully intend to keep it under active development. Please leave your feedback as comments here, or feel free to email me.

Related Books

Understanding Folksonomy: Catalyzing Users to Enrich Information Clean Code: A Handbook of Agile Software Craftsmanship (Robert C. Martin Series) Learning Python, 3rd Edition Early Adopter JSP Standard Tag Library Code Complete: A Practical Handbook of Software Construction

Comments

On October 06, 2008 at 07:28 AM wing wrote:

>py['pretext'] = "

Tags:""
I'm confused here.
You mean
py['pretext'] = "
Tags:\""
I can't make folksonomy working with my pyblosxom 1.4.3

Post a Comment




About

My name is Tim Fanelli, I am a software engineer in Northern NY. I spend most of my time working, and when I can, I try to post interesting things here.

Cigar Dossiers