Support from Acquia helps fund testing for Drupal Acquia logo

Comments

WilliamV’s picture

subscribe

WilliamV’s picture

Any updates on a drupa 7 port?

vingborg’s picture

FileSize
3.02 KB

I've attached a straight D7 port of Views Tree 2.0 (Views 3 compatible).

Crell, feel free to contact me directly if more work is needed on this, or simply commit it.

Murz’s picture

subscribe

geerlingguy’s picture

@vingborg - is this port compatible with the references or relations modules? I'd like to use it if at all possible, so I can have a hierarchy of nodes displayed that simply reference "parent" nodes using a node reference field provided by the references module.

[Edit: Just tried it using the node:nid as the "Main" field, and the network reference field as the "Parent" field, but that showed no content. I'm not exactly sure how this is supposed to work regardless, but I'm ready and willing to test :-)]

Edit 2: Nevermind. This module's working very well for what I need. The code in #3 would make a great start for the 7.x branch! I wasn't actually outputting the correct node ID in my view, causing the problem I had above.

geerlingguy’s picture

Status: Active » Needs work
FileSize
31.14 KB

The only problem I have is that I can't actually set the 'Wrapper class' or 'List class' for the display. This makes it a lot more annoying to theme the view (I have to override item-list for everything, since I can't change that class...). See attached screenshot for clarification.

vingborg’s picture

geerlinguy, is your comment directed at my port (#3) ? These two are remnants of the original D6 version, where they are not used either. It's a piece of software archeology, so to speak ;-)

geerlingguy’s picture

Ah, well, then, it seems everything else is working great!

geerlingguy’s picture

Status: Needs work » Reviewed & tested by the community

This theme function inside my theme's template.php file seems to work for what I need... gets rid of the .item-list class, at least:

function [themename]_views_tree_inner($variables) {
  $result = theme_views_tree_inner($variables);
  return '<div class="lists">' . $result . '</div>';
}
Crell’s picture

Status: Reviewed & tested by the community » Needs work

If there are vestigial bits of form lying around still, this isn't RTBC. :-) Well, maybe as a starting point. Either way, please provide a patch against 6.x-2.x, not a zip file. A zip file is much harder to properly merge into the code base. Thanks.

geerlingguy’s picture

Status: Needs work » Needs review
FileSize
5.46 KB

Patch against 6.x-2.x (I didn't create a new branch; I assume you'd do that after applying the patch...?).

vingborg’s picture

The vestigial form bits are carried over from the D6 version, and stems from the fact that the views style plugin inherits from another plugin that (supposedly) uses them. In essence, I should write code that explicitly removes those particular elements in both versions ... or write code that uses them properly (such as demoed in #9). In either case, it's not a D7 port issue as such, but I shall gladly give it a go at some point in the future :-)

geerlingguy’s picture

Attached patch (adding onto patch in #11) simply removes the two settings (for row class and 'item-list' wrapper class) from the display settings. I imagine we might someday wish to reinstate those settings, but for now, since they're not in use (and I don't think they were in 6.x-2.x either), we can simply remove them.

Patch is working great on a site I'm working on right now. Saved me a few hours' work already :)

geerlingguy’s picture

Title: d7 version? » Drupal 7 version of Views Tree

Updating title for those tracking via Tracker.

dboulet’s picture

Seems to me like we should be able to make use of the row and wrapper classes, since the 'HTML list' format makes use of them.

I also think that we could move most of the logic contained in the theme functions to preprocess functions, but maybe that is a separate issue altogether.

geerlingguy’s picture

@Crell - might I request to be added as a maintainer of Views Tree for D7.x? I'm using this module pretty heavily on one of my sites, and I'd love to help make sure the 7.x branch is running smoothly (which it is, so far, with the patch in #13 above ;-).

webankit’s picture

+1

damiandab’s picture

+1

vthirteen’s picture

subscribe

geek-merlin’s picture

sub!

mototribe’s picture

the zip in #3 worked for me too, pretty cool. Why not make it available in dev on the main page? There isn't much else available in D7 to show trees in a view

geerlingguy’s picture

Status: Needs review » Reviewed & tested by the community

Then maybe we can get this committed soon, and fix any new bugs in the 7.x branch. I'm still using the module on a pretty large site with the patch in #13 with nary a problem.

Todd Young’s picture

Todd likes this.

casey’s picture

sub

basicmagic.net’s picture

subscribe

Crell’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Fixed

OK, I finally got around to getting this committed. :-( Committed a slightly modified version of #13 (just whitespace cleanup and such, really) to a new 7.x-2.x branch, which has been pushed. A dev release should be available as soon as the packaging script gets around to it.

Also, somewhere around here I think I had an email from geerlingguy asking to com on as a co-maintainer for this module. Since he is using it and I'm barely touching it lately, I'm going to assume I wasn't imagining things and add him as a co-maintainer. Jeff, if I'm mistaking you for someone else I apologize. :-)

Thank you everyone for your patience.

geerlingguy’s picture

No, I did send that email, and would love to help maintain this module :) I'm still far enough away from Dave Reid syndrome that I can take on a module or two.

Crell’s picture

Oh good. :-) You're already a co-maintainer. Have at. (I need to jettison modules again...)

Crell’s picture

I just pushed an updated version of the port that does much more heavy refactoring to support Field API. The data structure for Field API in Views changed dramatically in Drupal 7, apparently, so I had to do some extra normalization to make everything work. geerlingguy, please verify that the stuff I just pushed works for you, too. If it does, then we can probably tag this at least a beta.

geerlingguy’s picture

Heading down to Texas tomorrow, so I'll try to test in between transit, otherwise I'll have to test things next week.

[Edit: Love the comment you added. I see you've added a little "magic" to the code...]

Crell’s picture

My code is easily recognized by obsessively detailed and highly opinionated comments detailing the crap I have to work around. :-)

Status: Fixed » Closed (fixed)

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