By allyak on
Hi there,
I've been searching for a while, but with no luck. I'm hoping somebody can help me with this question:
Is there an easy way to create a page that lists nodes of a taxonomy terms and its child terms? i.e. if I have a taxonomy of:
- Articles
- news (id: 2)
- book reviews (id: 3)
- fiction (id: 4)
- non-fiction (id: 5)
- recipes (id: 6)
I'd like a page that lists all the nodes tagged as "book reviews" or its child categories of "fiction" and "non-fiction".
I know I could use a URL like: www.mysite.com/taxonomy/term/3,4,5 to achieve this, but I'd like a way to have all the child category nodes included automatically, so that I add another child term I don't have to go and change all the links.
Is there any easy way to do this / pre-written chunk of code / module that I've missed?
Cheers,
Ally
Comments
Depth?
Does /taxonomy/term/3/9 do what you want?
The 9 is the optional depth parameter, I just chose 9 as a high enough number to cover most situations.
--
Anton
New to Drupal? Please read this
Also: Forum posting tips
That does exactly what I want.
Thanks!
Now if only there was a way to a list of sub-category links at the top of the page .... :)
Try taxonomy_context, it
Try taxonomy_context, it seems to be what you need.
--
Jakob Persson - blog
Leancept – Digital effect and innovation agency
Category module
The category module should be able to take care of all your needs.
In this module, every category has a fixed depth, which you can set to '-1' to reflect an infinite depth. Every category is a node, so when you go to the 'node/x' page for that category, that page uses the depth that you specified. There is also an alternate 'category/x/y' page, where you can specify the depth dynamically (like you can do with taxonomy).
You can also use the bundled category_display module to automatically list child categories (much like the book module lists child book pages), and other navigational aids (such as prev / next / up links).
Jeremy Epstein - GreenAsh
Jeremy Epstein - GreenAsh
Looks like that'll do it... but now to get *really* tricky
Thanks for the tip-off about the category.module, will check it out. Since you've all been blindingly quick and accurate with replues, time to really test you!
Is there a way (with or without the category.module) to exclude a particular category?
On my site I have an 'Archive' term that I use to tag things I'd like to remove from the normal taxonomy view, in addition to normal terms ('book review', 'non-Fiction', 'recipe', etc). So continuing the above example
So an old book review might be tagged with both "fiction" and "2004 archive".
Further to my question above, is there any easy way to use taxanomy URLs to show all book reviews, except those in the 2004 archive? (So instead of www.mysite.com/taxonomy/term/3/9, something more akin to www.mysite.com/taxonomy/term/3/9-1).
Is there are a solution / pre-written chunk of code / module that I've again missed?
Cheers,
Ally
Hard, but not impossible
My my, you are one TOUGH customer, Ally! :-p However, luckily for you, I like a challenge...
It IS (in theory) possible to do what you want, by using the category module, the views module, and the new module that integrates the two (called category_views - you'll find it in the 'contrib' directory of the category package).
You can configure the 'articles' container (aka vocabulary) to rely on a view (that you create) for rendering its node listing. How you configure this view is up to you. The usual way to create a view with category_views is simply to specify the category ID as an argument, and to filter by nodes of the specified category. But you can just as easily add another filter to your view, excluding nodes in another category (such as '2004 archive').
Let us know how you go with this - if you succeed in doing this, you are breaking through cutting-edge, never-before-done Drupal techniques.
Jeremy Epstein - GreenAsh
Jeremy Epstein - GreenAsh
One Global Tags Container applied to all others
Hi all, hello jaza and a big up for your category module, that after some learning is revealing *extremely* usefull!
Pardon me if i jump in this topic, but i am trying to do something similar to allyak, so i repeat his example structure below to push the thing a bit further
Is possible to have a "global" tags container showing in all other categories:
to let me "filter" every category content by some terms, in this case Year and Publisher?
This would let users browse to the Recipes category page
Home > articles > recipesand be able to narrow the results by the publisher who wrote them clicking on the appropriate link
or by year
Same "filtering" would possibly be done with News, Book reviews and other categories of the site
Is this sciencefiction for now, or maybe is possible to squeeze some more the category.module or some other and suxeed in this?
Maybe the right way to do this is with Distant parents? Or just leveraging on URLs based on taxonomy syntax (taxonomy/term/x,y)?
many thanks for any reply
(subcribe)
just subscribing
-Stefan