I have started working on a little "bonus view type" module to address the original request made in this post: http://drupal.org/node/186471
I created a very simple view-type plugin (based on the examples from the views bonus pack) to create a directory-like listing of nodes-by-category. Not too dissimilar from tree lineage, but it actually displays links to the nodes themselves, embedded in the taxonomy tree.
This is exactly the kind of summary view I've been trying to get for a project I'm working on (to create a very simple business directory for a small community using taxonomy for the business categories - the list of businesses is so small that a two-level view is overkill) and there seemed to be a lot of interest in the thread.
I've attached version 0.1, which is very preliminary. I paired the functionality right down so I could get it working - currently it simply looks at the first node returned by the view, grabs the first taxonomy term from that node, and then creates a directory-like tree of the taxonomy that view comes from along with all of its nodes. It does not yet use much of the information set in the view - e.g., it does not use the Fields (it always displays the title as a link) and it ignores the Filter and simply shows all nodes from that taxonomy. But it does show potential - this was only meant as a proto-type and proof-of-concept.
To use the module, unzip the package in your modules folder (sites/all/modules) and then enable the "nodes-by-category directory" module in the Modules panel.
Now go and create a summary view, that filters the nodes you want to show and has ONE argument - the Term ID summary.
Hopefully when you look at the view, you'll see something similar to the attached image.
This is my first attempt at writing a module for Drupal, and I would like to develop this module further, but I need to know:
- is this useful? are there people interested in it?
- what's the best name for this view type? directory? nodes-by-category? node-tree?
- could it eventually be included in the view bonus pack, as that is where it really belongs?
-
I shall await the verdict of the Drupal community.
| Comment | File | Size | Author |
|---|---|---|---|
| bonus_directory.gif | 3.73 KB | jfall | |
| views_bonus_directory-5.x-0.1-dev.zip | 9.05 KB | jfall |
Issue fork views_bonus-223700
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
jfall commentedJust found a Views Module Snippet that does just this!
http://drupal.org/node/225426
Still hoping to turn this into a full fledged plug-in, seems like there is a demand for this type of view.
Comment #2
jfall commentedPlease don't use the code posted above - it is a first attempt, and pretty lame. Here's a much improved version based on the code snippet above... but it's not a module....
Two primary problems with this idea as a module:
Thus, I've created a little "modulette" to create a summary view nodes-by-category directory listing. It works very nicely, will traverse to any depth in the hierarchy, puts each term in a collapsible fieldset, and provides control over whether empty terms should be shown or not. But it's not a module, just some functions with a single API that you can call from your summary view override function in template.php
More details, an example of the code in use, and a download are available at: http://lasqueti.ca/marketplace/directory
I'll look back into turning this into a full-fledged module for Views 2.
Comment #3
pomliane commentedThis version of Views Bonus Pack is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.