Initial conversation related to https://drupal.org/node/1967812
Create a Vocabulary with at least two levels as such :
Parent 1
Parent 2
- Child 2.1
- Child 2.2
Parent 3
Assuming that:
- Some nodes can be directly referencing parent terms like "Parent 1" or "Parent 3".
- Some nodes can be directly referencing Children terms like "Child 2.1"
- There cannot be nodes referencing parent terms that have children terms. Ex : there cannot be nodes referencing "Parent 2".
- The Exposed Filter is of type Content : has taxonomy terms (with depth) using a depth value of 1.
Expected behavior:
If the exposed filter is set to "Parent 1", all/only nodes referencing "Parent 1" should be retrieved
If the exposed filter is set to "Child 2.1" all/only nodes referencing "Child 2.1" should be retrieved
If the exposed filter is set to "Parent 2" all/only nodes referencing "Child 2.1" and also "Child 2.2" should be retrieved
Comments
Comment #1
nicolas bouteille commentedFirst question from gan_drupal
@Nicolas - Thanks. Actually I'm also trying to get the same behavior. But not able to get the below expected behavior:
"If the exposed filter is set to "Parent 2" all/only nodes referencing "Child 2.1" and also "Child 2.2" should be retrieved"
Meant, if i select Parent 2, my result out of it is nothing.
How do i get this using Views + Drupal 6 ? Can anyone help on this ?
Comment #2
nicolas bouteille commentedFirst answer by Nick
Hi, I am not sure I understand your question so maybe this won't answer it...
Here's how you can achieve this behavior with Views on D6.
In Views, add a new filter (by clicking on the "+" icon in the Filters section on the right, then scrolling down a bit to configure the filter)
Refine the filters list by selecting "Taxonomy" in the dropdown menu, then select the filter called "Taxonomy: Term ID (with depth)".
Set the depth to be at least 1 or more according to your need. There is a description that explains you how the depth works.
That should be it. Let me know if it helped !
++
Nick
Comment #3
nicolas bouteille commentedgan_drupal
Thanks a lot @Nicolas. I got it now.
What i was trying now is, when i click the checkbox of child 2.1 and hit on search button i got the expected result, when i try to search for child 2.2 also i got the result.
Now what i need is, when i click on parent 2, i got the result with both child 2.1 and 2.2, but the checkboxes are not checked for child 2.1 and 2.2.
I want both the checkboxes to be checked when i click on parent 2 for search. In the same way, if i check both child 2.1 and child 2.2, then parent 2 should also be checked automatically. Is it possible ? please advice.
Comment #4
nicolas bouteille commentedI personally don't know of any Drupal module that would do that for you. I think your best option is to do this manually using jQuery.
Comment #5
mustanggb commented