Multiselect Taxonomy Other:

maria_zk - July 24, 2009 - 18:16

Hello!!

What is the best way to achieve the following?
I have a multiselect taxonomy voc, related to a content type, and when a user creates content he should see st like this:

Voc 1
Term 1
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)
Term 2
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)
Term 3
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)
General Other:________ (free tag)

For the checkboxes i could use betterselect module, but what modules should i use for the users to fill in their own (free) tags under the relevant term?

Thank you!

Already possible with taxonomy module?

Chris Einkauf - July 24, 2009 - 18:45

I have freetagging on my site, but I think it was just the regular taxonomy module that offered me that feature. When I go to admin/content/taxonomy and then click to edit one of the vocabs, I enable the checkbox that says Tags ("Terms are created by users when submitting posts by typing a comma separated list.")

I also have the Tagadelic (to display the user tags in a tag cloud) and Community Tags (to allow users to tag other users' content and keep a record of which users assigned which tags to the content... i.e. to go one step beyond just having one set of the user tags that the community has to basically agree on, if that makes sense) modules installed, but I'm pretty sure the basic function of allowing free tagging was with the plain-old taxonomy module.

Thank you for reply. Here's

maria_zk - July 24, 2009 - 18:59

Thank you for reply. Here's the thing: I would like to have a freetagging option as leaves in the taxonomy tree (i use taxonoomy super select for this). What you describe would introduce a freetagging fields, but i need more than that (e.g. 3), one onder each voc category.

I am experimenting with content taxonomy module, this provides a freetagging text area, if only i could make it appear as a leaf under the specific taxonomy tree...

How about...

Chris Einkauf - July 24, 2009 - 19:21

Using Content Taxonomy module, can you just specify the parent term for that field? I know it's possible for something like a select list using content taxonomy, but I haven't tried it with freetagging.

Talking about content

maria_zk - July 24, 2009 - 19:40

Talking about content taxonomy, I was wondering if the following is a good idea or not.

I have a quite long vocabulary. Now, i can use content taxonomy with taxonomy manager to display some leaves of the taxonomy tree. So maybe i could use one field to display the leaves of term 1, then another field for term 1 freetagging etc etc.

In the end i would have a result like this:

Term 1 (Content taxonomy field_term1)
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (content taxonomy freetagging_field_1)

Term 2 (Content taxonomy field_term2)
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (content taxonomy freetagging_field_2)

In the end, i could weight the fields accordingly.

What do you think of this approach??

That Could Work

Chris Einkauf - July 24, 2009 - 20:33

That looks like a pretty good approach.

Because content taxonomy stores the taxonomy values in its own cck tables rather than in the regular taxonomy table, you shouldn't have to worry about the fact that the regular taxonomy module doesn't allow multiple groups of free tags within the same vocab. For the configuration details of the content taxonomy field, remember to NOT check the checkbox for storing the values in the regular taxonomy table as well.

Cool... If I could only find

maria_zk - July 24, 2009 - 20:54

Cool... If I could only find the last piece of the puzzle that would be great....

The vocabulary is actually in this form:

VOC
----------------
Term 1
Term 2
Term 3
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)
Term 4
Term 5
Term 6
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)
General Other:________ (general voc free tag)

So... with the above approach would work for the subterm groups, but what happens for the single terms -no group, like term 1- ? I cannot create single checboxes with content profile, right? And even if i could, there would be ~100 fields. Is this still a good approach?

BTW eink21, i can;t tell you how much i appreciate your help...

Hmm

Chris Einkauf - July 24, 2009 - 23:20

I'm thinking you could have one content taxonomy field for all your no-group terms (we'll call it field_toplevelterms for now), as well as a content taxonomy field for each of your groups of terms. In the settings for field_toplevelterms, you'd limit the possible choices to the no-group terms. Then, in your custom node form template, you'd be able to adjust the order in which those terms appear by rendering each term individually and interspersing the rendering of the group terms' content taxonomy fields. I'm not sure what exact code you'd need to use to render an individual term, but all the data you'd need to use should be present in one way or another.

If that sounds too complicated coding-wise, you could always do something like this...

field_taxonomyfield1:
Term 1
Term 2

field_taxonomyfield2:
Term 3
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)

field_taxonomyfield3:
Term 4
Term 5

field_taxonomyfield4:
Term 6
[ ] Subterm 1
[ ] Subterm 2
[ ] Subterm 3
Other:_______ (free tag)

field_taxonomyfield5:
General Other:________ (general voc free tag)

Once again, you could customize the look and feel of this in your template, but at least you won't have to worry about the whole rendering thing.

Oh, and you're very welcome. Glad to help.

Sounds great :) I will try to

maria_zk - July 25, 2009 - 03:46

Sounds great :) I will try to implement the first solution, as I find it more correct - though more complicated to utilize.

I had Taxonomy Super Select in mind, which is the module I used to present the vocabulary as checkboxes for the user.
I see now that I can also achieve this with content taxonomy alone, no need for super select, right?

Any help with displaying the terms of field_toplevelterms one at a time in page.tpl (or template.php???) (so that it would look correctly weighted) would be greatly appreciated.

If I find a solution, and hopefully I will since there are people like eink21 that help so much, I will post it here for everyone to see.
Once again, thank you so much :)

 
 

Drupal is a registered trademark of Dries Buytaert.