By jendyse on
Hi all,
I would like to know how to create a template or if there is a way how to display nodes from each subcategory.
I have this structure for example: Languages/French/Grammar and have articles related to the Grammar for example.
So my problem is when user will go on for example www.mydomain.com/languages/french/grammar/ he will see list of article teasers.
I was playing with the idea to build for each subcategory page via Views(Where I can set up e.g. filter: french=grammar)
but in this case I should create nearly 30 template which is quite unlogical.
Does anybody know how to solve this problem?
Any help is appreciated! Thanks in advance for your tips!
Honza
Comments
Already done, but you can enhance it with Views+Panels
You don't have to do this. It's already done for you. You can, however, make it better.
Taxonomy already provides such a view for each term at /taxonomy/term/TID (where TID == the term ID). Pathauto will map the URL appropriately to languages/french/grammar if you configure it to use the vocabulary/taxpath, assuming you have arranged your taxonomy terms in a heirarchy.
You're right about not wanting to create 30 views. In general, you don't want to hardcode values into a whole bunch of separate Views if you can pass them as arguments to a common, generalized View. The args can be passed in the URL, or in the case of Views blocks, explicitly by taking advantage of the flexibility provided by the Panels module.
If you want to enhance the page, you could use Panels to override the taxonomy term view, and embed a custom view (to which you would pass an argument), and perhaps custom blocks (which also could be passed arguments).
For example, let's say you want to place a nice synopsis of the category on the top of the page listing the articles. You could use CCK to create a custom content type "catergoryoverview." Write a categoryoverview for each term. Your custom Panels taxonomy page would then pull in the contents of the appropriate categoryoverview node, then display the usual headline/teaser list below it.
We do something like this on our newspaper sites. For example, /sports/basketball would give you a headline+teaser list of all the basketball stories with some enhanced sort options. We have a separate vocabulary for authors, so /authors/joebaloney would give you a similar list of Joe Baloney's stories. But we go beyond that: If displaying an author who has a profile in the system, we pull in a block containing a mini-profile of that author. So /authors/joebaloney would have, at the top, a picture of Joe Baloney, a summary of his background, and a link to his profile page -- followed by the usual headline/teaser list of his stories.
Thanks
Big thanks to you!