Want to get Lullabot article, videocast, and podcast announcements delivered right to your in-box? Let us know your email address (we won't share it) and we'll let you know when anything exciting happens.

Single Select Free Tagging

I've said it before. One of Drupal's greatest strengths is its taxonomy system. And Drupal 4.7 introduces "free tagging", which is basically the ability to add taxonomy terms on the fly to a given vocabulary. So you can type in a list of "tags", and if these terms exist in the given vocabulary, your content will be assigned those terms. If any terms do NOT exist in the vocabulary, they will be added to the vocabulary and then assigned to your content. The end result is a simple textfield where you can type a comma separated list of tags for your content. What's more, 4.7 has some ajax wizardry that will attempt to autocomplete with existing tags as you type.

But free tagging is currently only a multiple select system - meaning that any free tagging textfield will accept multiple terms. This is fine for conventional free tagging in the way that del.icio.us or flickr does it.

But I am looking for a different type of "create a term on the fly" functionality - a single select which would work like this.

If the term that a user is looking for is not in the list, they can select "other...". This triggers JS to display the hidden "other" textfield and transfer focus to it. The user enters their new term and they're off and running. This would degrade in that the "other" field would appear always for non-JS browsers, but it would not be recognized unless the "other..." select was chosen.

Comments on this post will automatically be closed three months from the original post date.

Comments

That's Cool.

That's cool and I'd use it. I don't like having my free-tagging descriptors text field always showing up.

I use multi-select boxes for my terms. What would you think about using this in a multi select as well. I'd have the 'other...' at the top or the bottom of the list.

or...

another way to do it would be to mimic gmail's file attachment.

You choose a file (tag) to add. It could be a simple text field with ajax autocomplete. If you want to add another tag you hit "add another" and you get another text field that ajaxically appears below the first. ad infinitum.

I think I may have done

I think I may have done something similar to what you are looking for. If you visit the following form:

http://summersidesaltspring.com/information.php

And choose 'other' from the How Did You Find Our Website section you'll see you can dynamically change the option.

more intuitive

this is great. i think this is more intuitive than the free tagging text field. granted if you have 300 terms, it would be a lot to scroll through, but seeing the available terms besides via the suggestive js when you start typing is helpful to the user.

the way delicious show suggested terms, and all terms, and makes them clickable, is easy on the user. if no comma was needed for free tagging in drupal, it would make this js work better if you're using a text field - or, just have the js put the comma after each term for the user.

i also thought giving the user a place to fill in a description for the new term would be neat.

Ian

Community managed categories

Agaric Design Collective is interested in this, and extending this to community managed categories (taxonomy vocabularies). This is two steps beyond this:

1. Allow people to add terms who cannot edit the content (node) itself.
2. Allow people to vote for merging terms (making them synonyms).

If you're want this too (or even better know someone who's done/doing something like it), contact Agaric!

taxonomy otf for drupal 4.7

Hi,

I think this functionality was in the taxonomy_otf module.
But this module has not been updated to drupal 4.7
I am not a programmer, but if anyone would be able to update the module I will help test it.

There is functionality sort of what you propose, but it is not working in drupal 4.7 together with the great category.module.

Please if anyone has this functionality or parent selecting with free tagging, please pm me on drupal:http://drupal.org/user/54207
greetings,
Martijn

is this possible now ?

hi jeff, did you come up with a solution for this since then ?

Your post is clearly old,

Your post is clearly old, but any further thoughts/development on this for 5.x -- or now even 6?

More extensible solution

Yes this post is a little old but I'll still put in my two sense.

I like Jeff's idea and agree that it should be easy to add a single category on the fly while adding a "node". However, the solution described above would need to be more extensible. In that, I mean that you would need to be able to at least configure it to accept more meta data for the category.

Some modules, like Taxonomy Context utilize the description and other data that is entered when adding a Category from the default form.

So perhaps using AJAX to pull a minimalised "term_add_form" would be a good approach for something like this.

Taxonomy Other module

Is this what you're looking for?

http://drupal.org/project/taxonomy_other