I apologize in advance if this is already possible. The fantastic Views module has so many features, I may be getting confused :).
First, I would like to filter a tabular list according to a given taxonomy term. This is easy to do in the filter settings. So far so good. But then I would like to use the terms of another taxonomy vocabulary as a column in the table -- so that the user can see more features of each node and sort the table according to this vocabulary.
For example, I filter the table to contain only nodes of the "Fruit" category. But then I would like to list the kind of fruit, e.g., apple, pear, orange, next to the name of the node.
Thanks for a truly great module!
--Neil
Comments
Comment #1
merlinofchaos commentedI have good news and I have bad news.
The good news is that yes you can do this.
The bad news is that the only reasonable way to do it is with a theme. Because there's a variable number of terms, it's pretty difficult to get anything other than the term that you're sorting/filtering on.
If you theme it, however, you can do load the node, or just load the terms. It's less efficient but I think the only way to do what you want.
The good news is that theming isn't hard. ASsuming phptemplate:
Copy the code from theme_views_view() in views.module and replace the switch with the contents of views_view_table(). Then you can just add columns as you need.
Comment #2
merlinofchaos commentedNow that I'm a bit more awake I went ahead and put the function a bit more together for you.
Replace VIEWNAME with the view you want, and you can add fields to your heart's content by
adding another $cell structure to the row.
Comment #3
merlinofchaos commentedLeaving this as active because this is a nice start for an example in the theming documentation which still needs to be written.
Comment #4
ohzbees commentedAwesome! I don't have time right now to try it out, but I will soon.
Comment #5
merlinofchaos commentedChanging title and parameters so that I remember what this is the when I look at my issues queue.
Comment #6
merlinofchaos commentedUsing http://drupal.org/node/47845 to track the documentation now. Including a back-reference.