I'm working on a style plugin for lineage that would allow terms to be nested indefinitely based on their lineage. I propose including this as a part of the lineage module since it would be a useful and expected feature for using lineage with views. References and related issues:

Views:
#502348: How group display by mutliple fields?

Views bonus pack:
#346324: Upgrade Lineage Nested to D6

Lineage:
#555316: Views 2: Improve field handler
#507472: Fix weight string handling for D6

Related forum topic:
http://drupal.org/node/435542

I will attach a patch with the style plugin once I am done with it.

CommentFileSizeAuthor
#7 lineage-612908-7.patch6.59 KBxjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Flying Drupalist’s picture

Subscribe

fm’s picture

subscribe

joel_guesclin’s picture

Maybe one could achieve something similar by using the Semantic Views module?

xjm’s picture

I'm not sure that semantic views would do the trick, since the entire grouping structure of the list needs to be overridden (rather than just the row style) and furthermore needs to include some recursion. It could be that I just don't know how to use that module effectively. If you get it working with that module, could you post a recipe?

xjm’s picture

Status: Active » Postponed

Status update--I have this functionality mostly working and I should have a patch available for testing within the 10 days. However, #699198: Add lineage_strip_weights() and refactor field handler to use this function should go in first and will affect the style plugin's methods, so I'm marking this "postponed" pending that change.

xjm’s picture

Status: Postponed » Active
xjm’s picture

Status: Active » Needs review
FileSize
6.59 KB

Here's a patch implementing this feature (finally).

Suggested use:

  1. Add a Taxonomy: Hierarchy field.
  2. Add your hierarchy field as a sort criterion.
  3. Filter your view by Taxonomy: Vocabulary as your hierarchical vocabulary.
  4. Change the view style to Lineage nested list and set the Nesting field to your hierarchy field.

Note: Patch includes multiple files and is therefore rolled at the directory level, so use the -p option to apply it.

xjm’s picture

Committed to dev branch.

xjm’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mediamash’s picture

Status: Closed (fixed) » Needs work

works fine, only seems to give some ajax-errors when enabled

xjm’s picture

What sorts of errors are you getting? What steps can be taken to reproduce these errors?

xjm’s picture

Status: Needs work » Postponed (maintainer needs more info)
stinky’s picture

After running the patch I get the following error msg
:Fatal error: Cannot redeclare lineage_get_weight() (previously declared in /var/www/html/sled/modules/lineage/lineage.module:252) in /var/www/html/sled/modules/lineage/lineage.module on line 278:

xjm’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

You shouldn't need to apply the patch; the feature is already committed. Just use the latest dev build.

A separate issue should be opened for the ajax errors (@#11).