Community tagging solutions for Drupal, a comparision

Since the 4.7 version, Drupal has free tagging included by default. Unfortunately this only allows for a shared tag set for a node, so that when multiple people tag a node, those tags go into a common list. Who tagged the node is not remembered, anyone can remove any tags and add new ones (given the permission).

Some people argued that this system should be called folksonomy, because at that time that was the hype of the day. Luckily the free tagging name was kept. Although if you need real folksonomy support (per user tagging, editing of own tags, personal tag clouds but still powering a common tag set), you need to look into a contributed module. Interestingly there are two similar solutions for the problem: the community_tags module and the taxonomy_user module. Since I need this functionality for a project, I needed to look at them, so here is a rundown of the differences I see from looking at their implementation.

Examined versions

I have code reviewed (not tried in runtime) both modules. The two files used were community_tags-4.7.x-1.x-dev.tar.gz (dated 2007-Jan-08) and taxonomy_user-4.7.x-1.1.tar.gz (dated 2006-Dec-18).

Extra table

Both modules use an extra table to store term to user relationships. Both of them suffer from the fact that the term_node table has no id to use, so they need to duplicate the nid-tid relationship here to associate with users, and consequently this relationship needs to be repeated every time a different user tags the same node with the same tid. Community tags also stores the date when a tag was applied.

Taxonomy dependency

Both modules make heavy use of the existing free tagging feature of the taxonomy module. Community tags require you to first set up at least one free tagging vocabulary and then choose one on the community tags setup page for usage by the module. An interesting glitch of the community tags module implementation as far as I see is that it prefers the first tagging vocabulary even if you set the default tagging vocabulary to be different (ie, if you have a tag vocabulary for admins for "official tagging" and one for other users).

Taxonomy user however modifies the vocabulary editing form, so you can enable vocabularies to relate users to tags. Taxonomy user also sets the choosen vocabularies to be handled by taxonomy_user (which is only relevant for path construction). This is done with a 'checkboxes' list for whatever reason, which seems odd. Because taxonomy user allows setting of any number of vocabularies to be user tag enabled, it is possible to have multiple such vocabularies, although there is little point in this IMHO.

Displayed tags

Both modules require tagadelic module to display tag clouds.

Community tags shows an overall tag cloud and a user specific tag cloud on nodes. The same is done under the 'tag this' tab. The tags are also displayed along the other taxonomy terms, as provided by taxonomy module by default. This module has some nice hidden tag cloud features (a global tag cloud and a node type based tag cloud), but these are not shown on the interface.

Taxonomy user also provides options to display a tag list when a node is being displayed. It is possible to fold tags into the taxonomy term list (as community tags does), but it is also possible to have a simple list above or below the node body (but unlike community tags, this is not a tag cloud). Additionaly the module provides a 'my tags' block, which shows a tag cloud of the logged in user. A nice feature here is that pages are provided where you can see nodes tagged by you with a selected tag.

Tagging user interaction

Community tags provides an inline tagging form on the node view page and a 'tag this' tab on nodes, so people can tag on a standalone page too. I don't see a reason, why both of these exist, since they effectively duplicate functionality and clearly duplicate code in the module. Community tags provide the 'tag content' and 'edit own tags' permissions, so some people might only be able to add tags and not edit them later, if you want to. If someone even has permission to edit a node and can modify the free tagging there, he can edit/remove all tags.

Taxonomy user allows tag editing directly on the node editing page (so users need to have permission to get to that page first to add their own personal tags). I don't think this is a good idea, but the module seems to be ready even for anonymous users tagging stuff (there are explicit signs of this in the code). A nice touch here however is that in the form item description the module shows what others tagged on the node.

Both modules use a big chunck of code copied from taxonomy module to parse the format of the tagging form input item, and get the term id for the terms typed in.

Getting around taxonomy module

Both modules need features of taxonomy module, but do need to hide some inner details from that module, to work as advertised.

Community tags modifies the weight of itself on install time, to come after taxonomy module when hooks are invoked. Then it manages the community_tags and term_node tables when needed, given that (in the case of the node editing page) the taxonomy module already done the insertions and deletions as if the free tagging vocabulary was a global tag set.

Taxonomy user replaces the contents of the free tagging form input with the current users tag only, and stores other users tags in a form API value. Later when the form is submitted, the user tags are parsed and saved and then other users tags are tacked on the list and that is handed over to taxonomy module, so it can save all tags. There does not seem to be escaping of the other tags when added onto the global tag list. On node submit, user tags are first removed for the current user, then added back one by one.

What to use? Hard to say!

From the looks, both of these modules are in development (or are left intact from a stage where they were in development). Both of them have nice features, and both of them seem to have possible bugs. Community tags has custom form handling, which allows for quicker tagging. But the mixing of the custom form and the node edit form handling makes for a highly complicated data handler. Taxonomy user on the other hand has an awkward place to edit user tags but provides better guidance in terms of the user specific tag pages and the form item help provided.

As it was expected (unfortunately) I would need some cross between the two modules: allowing the community to tag (not only the admin users who have permission to edit nodes), but then provide them with more guidance. All this would be nice in a more streamlined module. I would either be able to start off with community tags and remove duplicate functionality (tag tab and inline tagging) and moving off the tag editing to a custom form item to not interfer with taxonomy module; or would start off from taxonomy user to move the editing out of the node form and provide better tag displays.

Either way, it is unfortunate that these nice modules were developed in paralell, and their maintainers are not (yet?) working on a better implementation to bring the functionality of the modules closer. I will try to bring this comparision to their attention as a start.


webchick's picture

The question about how they differ comes up a lot; I'm glad someone got around to answering it. ;)

I can speak to a few of the design decisions around Community Tags:

1. This module got its start as a patch of RobRoy's for Tagadelic: This patch essentially re-wrote the entire module to add in these features, and Ber preferred to keep Tagadelic to simple tag cloud generation and not add in the other stuff. I started with that module, ripped out all the Tagadelic copy/paste stuff, and tried to debug it enough so it actually worked. ;)

2. There is both a menu item and a node entry form because for our client, we needed a "tag this" button that led off to a separate form, rather than having the form on the node itself. However, the original version of the module had this functionality in it, so I figured I'd leave it.

3. I had originally intended on creating separate blocks for the "tag cloud for this node," "tag cloud for this node type," etc. but settled on a theme function instead because the intent had been to Views-enable Community Tags, so Views would've taken care of the block stuff. Unfortunately, the client's deadline loomed and that never ended up materializing.

I would fully support an effort to combine these modules. I personally probably won't work on it, however... this was work for a client, and it's doing a good enough job for them atm. That said, I know Bryght has taken an interest in the module, and Steven's committed a few fixes. If you want to lead the effort of combining the two, I'd be happy to give you maintainer permissions to Community Tags to try and roll in some of the functionality that user_taxonomy has. I agree that it doesn't make sense to have two modules that do the same thing.

Anonymous's picture

one thing I have noticed about add-ons or modules in any open-source environment is that eventually, one will get more popular, and the other will begin to fade away. Or another common thing is that one of the developers will lose interest/time, and that project will die off. May the best taxonomy/folksonomy win.

Anonymous's picture

I had originally intended on creating separate blocks for the "tag cloud for this node," "tag cloud for this node type," etc. but settled on a theme function instead because the intent had been to Views-enable Community Tags, so Views would've taken care of the block stuff. Unfortunately, the client's deadline loomed and that never ended up materializing.

alex_b's picture


Thank you very much for your helpful review.

We are currently holding off from further developing of taxonomy_user because the website we are deploying it on is rolled out and there are no new features being added. As soon as we go into another round of development with this project, I will be able to direct more attention to user-related tags again.

That also means, that I have a strong interest that we come up with a good solution of how to unify community_tags and taxonomy_user.

Some additions to your observations:
I just turned on community_tags. The inline tagging form is awsome. I am missing a distinction between My Tags and other people's tags. I experienced a peculiar behaviour: after three added tags community tags started to replace my latest tag instead of adding a new one. What's a very useful feature is that community_tags saves a timestamp of when a tag was created, that opens a whole world of possiblities.

Having various free tagging vocabularies "user-enabled" does make sense: think of different vocabularies for different node types or different og groups.

What's missing for me in both modules, is an interface to views module - in taxonomy_user that would make the taxonomy_user/term pages that show only the nodes that _you_ tagged obsolete. On the long run, a better integration with taxonomy module without replicating its code would save us a lot of headaches.

And finally a question: do you have any observations/preferences on how community_tags and taxonomy_user technically solved saving user related terms?

Thanks again for your great job on reviewing those modules.


discursives's picture

Alex, what is your sense of how you will proceed from here?

Gábor Hojtsy's picture

Unfortunately now I am completely taken by the i18n working group, as I am also working on my diploma in that topic, so I needed to put this topic on my TODO list for later. I posted the above in the hopes that it encourages collaboration in this area.

alex_b's picture

Julian Tschannen is working on a similar module and he got pretty far already. He is currently deploying it on a production site. The tagging form looks GREAT (flickr-style) and the functionality of the module is aiming at a broad set of uses. (see modes)

I just talked to Julian on IM. His module called "tagging" could be a replacement for taxonomy_user and community_tags he said.

What tagging does not yet allow is that two users tag a node with the same term. On the theming layer, tagging does not distinguish between the current users tag and other's tags. There is no view of the current users tagged nodes like in taxonomy user (taxonomy_user/term/). I am not entirely sure what else is different from community tags and taxonomy user. Julian, would you like to put up a comparison based on Gabor's comparison here? BTW: Please don't mind this little "what I don't find" list - I am sure it is incomplete and skewed from the view of the taxonomy_user developer.

Can we download the tagging module from somewhere?

Gabor, what are you up to with user tagging functionality? Are you planning any concrete development? I for my part I have to wait until the project I am deploying taxonomy_user on goes into the next production phase. Then I will put in all my effort into unification.


alex_b's picture

bono tony g poker's picture

Community tags version 6 is out now, even when this module is no longer a rival of Taxonomy user. We can try both of them, diferent software for each one needs. Personally i keep taxonomy because several contributed modules make powerful use of the categories (taxonomy) module, exploiting and extending what it can do.

Anonymous's picture

Update (please add to the main article)
Taxonomy user is no longer maintained and
does not work with Drupal 6.14 properly.
The Taxonomy user project has been abandoned as there are no downloadable version.