Needs work
Project:
Content Taxonomy
Version:
6.x-1.0-rc2
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Aug 2009 at 04:32 UTC
Updated:
21 Jun 2011 at 23:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
mh86 commentedparent terms are by default selectable (e.g. in any select box, checkboxes, radios).
additionally you can define the default value (here Term 1) in your field settings
Comment #2
Chris Einkauf commentedThanks for your reply mh86 (to this and to my other issue that you answered). Perhaps I am just missing something obvious, but I still can't get this to work. I'll use a different example to demonstrate what I want to do...
Let's assume my "animals" vocabulary looks like this:
Dog
--Big Dog
----Great Dane
----St. Bernard
--Small Dog
----Bichon Frise
----Toy Charles
Cat
--Big Cat
----Tiger
----Lion
--Small Cat
----Tabby Cat
----Persian
Now let's say I have a "Big Cat" content type, and in that content type's content taxonomy field, I want to ask the user what kind of big cat it is. I want these to be the options:
Big Cat (select this to just tag it as a big cat in general, i.e. if it's not a tiger or lion)
--Tiger
--Lion
When I set "Big Cat" as the parent term, the select box looks like this:
-None-
Tiger
Lion
So, there's no "Big Cat" option. If I instead set "Cat" as the parent term, the user gets the additional "Small Cat"-related options. How, then, would I go about just presenting Big Cat, Tiger, and Lion as options?
Comment #3
mh86 commentednow I understand the problem
At the moment there is no option to include the actual parent term in the select list. To solve this, you would need another parent term above the "Big Cat" term (your taxonomy maybe will look strange afterwards). Or you going to write a patch to support the optional listing of the parent term :-)
Comment #4
Chris Einkauf commentedThanks again for the reply, mh86. It definitely saved me from wasting some time playing around with the content taxonomy UI to try to get this to work.
I've never written a patch before, but I certainly wouldn't be opposed if I can actually come up with the solution to this. What program should I use to write a patch? Also, are there any good reading materials you'd recommend for getting me started with writing patches? I suppose I should also learn some of the basics of module building, but I've been wanting to learn that stuff anyway so this might be a good opportunity. (No promises about actually coming up with a working patch, though - I'm pretty noobish)
Comment #5
jameshenry commentedOne thing, that you could do, is autotagging the node "big cat" with the term "big cat". In addition to that you give the user the possibility to add the tags "Tiger" or "Lion" if they like.
In that case, every "big cat" node will be tagged with "big cat" and some will be tagged with "big cat" and "tiger" or "lion"
Autotagging can be done with the modul "taxonomy defaults"
http://drupal.org/project/taxonomy_defaults
(but be careful, this modul is not suppporting content taxonomy, that means you cannot use it to autofill a cck field of the type "content taxonomy", but you can use it to tag the node with the term related to the content taxonomy field)
Comment #6
Chris Einkauf commentedThanks Ned Needle. I'll check that out.
Comment #8
jcarnett commentedHere's a patch to add an "Include parent term" option on the field settings. Checking it adds the parent term to the exposed options in the form. I've only tested with the checkbox/radio and select widgets and it works for me so far.
Comment #9
tribe_of_dan commentedI tried this patch but I see no difference. I still can't select the parent term and parent term doesn't seem to be saved.
Comment #10
WilliamB commentedI was looking to do the same thing and customize the module.
I'm on Drupal 7 though.
But in the content_taxonomy.module file i only see the function that add the "parent" field.
Where and how are the taxonomy children selectioned in the code? I can't find it.
Comment #11
WilliamB commentedAnyone can help for Drupal 7?
Comment #12
tribe_of_dan commentedWould anybody be willing to make a patch so this works with Hierarchical Select?