By betamale on
So I have some stories written and I have a vocabulary with taxonomy terms structured like this:
Parent1
- Child1a
- Child1b
Parent2
- Child2a
- Child2b
When I write a story and choose Child1b, only that term displays when viewing the story.
What I am hoping to find is a way to have the parent (Parent1) to display when I choose Child1a or Child1b.
Hope somebody has something for this. Thanks.
Comments
subscribing
subscribing
eh? subscribing?
is this an answer?
It means I'll get updated if
It means I'll get updated if there is a new post. ;-)
I have been working on this as well, but haven't completely figured out. The only thing I have found out for this is how to display the parents and children links, and then to show the parents without the link. That is as far as I got. I don't remember where I saw this though.
Here are some links that might help you out:
http://drupal.org/handbook/modules/taxonomy
Google search: taxonomy code snippets site:drupal.org
Hope it helps :-)
Displaying Parent terms automatically when a child term is selec
Subscribing too... Anyone found a solution?
subscribing
subscribing
Use Hierarchical Select Module
Hi use the Hierarchical Select Module which will solve your question. Here the link is http://drupal.org/project/hierarchical_select
I'm afraid that is a very
I'm afraid that is a very unrelated suggestion.
I don't know of any modules that will just get you the parent, but in any case, you'll need to get your hands dirty with this one.
to get the parent of a taxonomy item you need to use http://api.drupal.org/api/function/taxonomy_get_tree/6 with the taxonomy id (vid) obtained from the $node object on your node.tpl.php.
this requires some programming experience, let me know if you still need this help, i notice this is an old thread.
Select term lineage option to the vocabulary setting
From the Original Question
Using Hierarchical taxonomy it is possible to display both parent and child in a node view with only the child element selected upon node creation. So selecting to child1a will display parent1.
For this to work, you need to select term lineage option to the vocabulary setting.
it seems inadequate and it's
it seems inadequate and it's not even usable for 6, a tiny function can do this without the overkill
what would that tiny function
what would that tiny function be? i could really use something along these lines. to be specific, i'm trying to setup my taxonomy where if someone creates a new story and assigns a child term, the parent term is automatically assigned as well. it's slightly different, perhaps, in that i'm looking to actually assign the parent term and not just display it, but it also seems like the solution would be very similar. any suggestions? (i'm using 6.13)
multiple parent limitation
i actually just realized the limitation of what i was suggesting. i didn't realize that in drupal taxonomy, you can have child terms with multiple parents. this is actually a very useful thing, but it complicates what i was looking for above. the solution i found is the hierarchical select module (http://drupal.org/project/hierarchical_select). though it is not automatic, it forces the user to select a lineage instead of just a single term. this serves my purpose as then all of the other functionality based on taxonomy on my site will work. (the worry was that users would forget or neglect to select a parent term and then views based on parent terms would be incomplete.)
thanks anyway though. if you did have the code already written, i would still be interested in seeing it for my own learning...