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.

Issue fork views_bonus-223700

Command icon 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

jfall’s picture

Just 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.

jfall’s picture

Please 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:

  • the Views Taxonomy:Term ID argument does not indicate which vocabulary the argument should come from - it could come from any, or all! That's intentional, and seems rational in most cases. In this case it kind-of sucks because there is no way to tell which vocab. to use to create the directory without forcing it to be specified as one of the view fields, which is also not desirable. To create a full-fledged views plugin for this idea, you'd need a way to specify the vocab. - perhaps through an admin setting - but I can't think of a flexible, intuitive, unrestrictive way to do this.
  • AFAIK Views currently does not provide a mechanism to plug-in summary view types that are distinct from the normal view. Views has its summaries (Display All; Not Found; Summary, unsorted; etc), and that's that. Since this summary view uses the normal view it needs to be selected separately.

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.

pomliane’s picture

Status: Active » Closed (won't fix)

This 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.

karoda_manoj made their first commit to this issue’s fork.