I took an opportunity this weekend (waiting out Irene! [and spying on the sump pump]) to look into the Views implementation in Node Hierarchy. I've done the following:

  • Cleaned up some deprecated code, renamed some elements to be more Views aligned, and cleaned up some title and labels.
  • Created the two filters based on the existing Parent nid and Ancestor nid arguments. If you would like to select parentless nids with the Parent nid filter, choose "is empty (NULL)." The Ancestor nid filter had some issues with the join, so it currently isn't allowing NULL.
  • Cleaned up and added the non-connected argument default. The original implementation seemed to work kinda sorta OK, so I'm not sure if it's going to be extremely useful and necessary for anybody.

Looking for some eyeballs to check it out!

CommentFileSizeAuthor
#1 nh-views-1263918-2.patch8.65 KBjbylsma

Comments

jbylsma’s picture

StatusFileSize
new8.65 KB

Attached patch

3cwebdev’s picture

Thank you for the effort on these improvements! I will test on my installation within a few day. Looks like these changes will be good though. Will this patch make it into the module?

jbylsma’s picture

Yup, once they've gone through some QA, I plan on pushing them into 6.x-2.x and 6.x-3.x. I'm guessing the default argument will get some more attention, but if that gets to be too much, I can separate that out to another issue.

3cwebdev’s picture

I've tried numerous methods to apply this patch on Windows and they all fail. I must be doing something wrong. If the patch is small I usually just apply it manually but this one is somewhat lengthy. I've done it before in Aptana but can't seem to get it to work now.

Please let me know if it gets rolled into dev at some point.

3cwebdev’s picture

Thank you for the patched module. I have updated the site and it appears to be working great. The new filters work as expected and the views that used node hierarchy arguments are still functioning correct. Thank you for your work on this and send me the patched module! It's nice being able to filter to parent nodes.

designguru’s picture

Is there any way to extend this patch to include a filter for child count? I'd like to create a view of parent nodes that is filtered to show only parents with children and currently can't figure out a way to do this.

q./

spineless’s picture

I am using views 7.x-3.x-dev. I have been able to filter all child pages for the user. I set up views with the following:

relationship : Book Parent
Filter : (book parent) Book : depth < =2

Using these settings I have been able to create a list that displays all of the children for the user. The parent pages are not viewed because the depth is set to >=2.

I created a BLOCK list for this child pages and placed the list in the content area of one of the parent pages of the three books i have on the site.

I hope this information helps someone......

MY ISSUE

The issue I am currently working on is being able to filter the list of child pages to a single book. So when i place the views block in the parent page it only displays the children for that book.

The module relations does not help me create a book relationship. Ideally it would be nice to filter by parent NID or some other ID common to the parent and children of the same book.

Does anyone know of a module i can use?

Does any one know how I can select the ID using taxonomy or a tag?

Thanks,
Spineless

mattcasey’s picture

Patch seems to work, although I haven't tried using the filters.. no errors, etc.

mikikiki’s picture

I use the "Node Hierarchy: Ancestor nid" argument

Is it possible to implement css classes to be able to format the results that now are:

-child1
-child2
-child1 of child2
-child2 of child2
-child3

like this:

-child1
-child2
----child1 of child2
----child2 of child2
-child3

I'd like to have something in the code saying the depth level of the node

jbylsma’s picture

Status: Needs review » Fixed

Committed. I couldn't reproduce the NULL "ancestor nid" filter problem I had before, so I've enabled NULL on the filter.

Status: Fixed » Closed (fixed)

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