By simmel on
Hello everybody,
I am setting up a image gallery with cck, imagecache, views and taxonomy. I have two layers of the album before the image is shown. Like that:
Year -> Event name -> Picture
To the image nodes there are taxonomy terms attached. Both terms, "year" and "event name" are from the same vocabulary but on different levels.
How can I filter in my view for the terms of the top taxonomy level? If I filter for the vocabulary, obviously all the terms are shown, but I just want the top level ones ("year").
I would be glad if someone has a nice idea!
Thank you very much, Simmel
Comments
Views filter on taxonomy top level
+1
Did you find anything?
Filter view: display only top-level terms in vocabulary
If you want to display the top-level terms of a given vocabulary, create a "term" view ("View type: Term") with these basic settings: a field for "Taxonomy:Term", an argument for "Taxonomy: Vocabulary ID"
Then to filter:
1) add a relationship to "Taxonomy: Parent term"
2) add a filter on "Taxonomy: Term ID", using relationship "Parent", with operator set to "Is empty (NULL)"
This will list only top-level terms for the given vocabulary.
Excellent explanation. I
Excellent explanation. I will mention taxonomy hierarchy, in case it might help other's Google searches.
Thank so much ! :D
Thank so much ! :D
Thanks ... very helpful !
Thanks ... very helpful !
Thantls, the answer was
Thantls, the answer was amazing!, three years later it stills rulez :D
Filter > Parent term >is
Filter > Parent term >is equal to
Leave it blank.
Walla.
-
Be the occasion.
Thanks @ mcdoolz
Thanks @ mcdoolz
your simple solution is working for me.
Also a little cleaner than the solution of ybresson because you don't need a relationship
Working fine
Thanks this working fine with me
Doesn't work for Depth
I just tried this exact setup and it still shows every term that is a "parent".
So if I have "County -> City -> Neighborhood" hierarchy, then the view settings above will show both "County" and "City" because they are both technically "parents".
Still looking for a solid setup to get only the top level parent term to show (with count).