i am relatively new to drupal and learning on 6.x and am currently using the node hierarchy module in parallel with the inherent menu hierarchy to develop some structure in my site(this is a good method of establishing structure i hope?). i would like to have a view where only the nodes that are children under node hierarchy are displayed on a node's page. i know this is possible somehow im just not sure how. right now i have node hierarchy module and its views integration enabled, as well as views module of course. have a view configured right now that works, it just displays all nodes in a list on any page that has the view enabled on it. how do i "limit" this list that is currently showing up on a node's page to only the nodes that are its children?

node hierarchy documentation says theres an arguement "Parent Node Id" but i dont know how to use this. it isnt really obvious.

thanks a lot.

Comments

CaHamdy’s picture

anyone?

dydecker’s picture

select Parent Node ID for the argument

In Fields, select node title etc of children you want to show on each parent page

in path write node/%

Now all parent nodes will show a view of children

If you want to put the view onto Parent pages as a block, select "Default argument = Node ID" in arguments

CaHamdy’s picture

thanks for the reply. for some reason parent node ID is not showing up under arguements. and i have all the necessary modules installed and active. this is strange no?

dstotijn’s picture

CaHamdy,

I encountered the same problem, isaac.niebeling hinted this could be caused by the latest version of the Views module not being compatible with the latest version of Node Hierarchy.

I rolled back to views-6.x-2.0-rc1, and sure enough the Node Hierarchy arguments were showing up in the Arguments list again!

Maybe this is also useful: the method I used to display children nodes of the same parent (sibling nodes) in a block view:

1. Create a View where you add a "Node Hierarchy: Parent Node" argument.
2. Select "Provide default argument", select "PHP Code" and enter:

$node = node_load(arg(1));
if ($node) {
  return $node->parent;
} else return;

3. To exclude the current node from the view, add another argument, "Node: Nid", same settings as in step 2 and enter the following code:

$node = node_load(arg(1));
if ($node) {
  return $node->nid;
} else return;

4. Be sure to tick the "Exclude the argument" box!

CaHamdy’s picture

ahh thanks. i guess the most recent versions of the modules don't work together. is there any way to let the developers know about this?

mrfelton’s picture

I got this feature working today with the latest development snapshot of node_hierarchy and views-rc4
--
Tom
codegobbler.com - web design and development

--
Tom
www.systemseed.com - drupal development. drupal training. drupal support.

break9’s picture

I am having trouble getting anything beyond the immediate children to display, can you enlighten me on how I could produce the children and grand children?

meecect’s picture

I've tried your solution but it doesn't seem to work. I am using pathauto aliases...could that be messing it up?

EDIT:

Scratch that...I didn't realize that there is no good way to test that snippet from the views page, because it relies on the fact that you aren't providing an argument (at which point the default php snippet kicks in) and without an argument, the views page doesn't have any node context.

If I view the block on a real page, it works.

CaHamdy’s picture

x

dstotijn’s picture

There is a new version of Node Hierarchy that restores compatibility with Views (version 2.0+): http://drupal.org/project/nodehierarchy

sean_e’s picture

check out how I have done it at my site at www.auscamping.com.au

I have used panels and views, and terms (heirachy) and taxonomy redirect.

any questions let me know

sean

kbellcpa’s picture

Hi sean_e,
Can you help me to display my parent, children and grandchildren on a page?

Thanks,
Karen

kbellcpa’s picture

I went to your site, but can't see the example. Do I need a login and password?