Hello,

I am trying to create a view that shows the children of a node. The page view works but I cannot get the block view to show. Any ideas?

Is this something I am not configuring right or this module does not support block views?

Thank you!

Comments

ronan’s picture

Views integration should work in a block, but by default, drupal blocks to not know what page they are being generated on or what node you are looking at. Try this:

Add the nodehierarchy parent argument to the view.
Add the following code to the argument handling code:

if (arg(0) == 'node' && is_numeric(arg(1))) {
    return array(arg(1));
}

That should display all children of the node you are currently looking at.

If you want to display the children of a given node that is the same wherever the block appears use:

  return array( 12345 );

where 12345 is the node id

R

kirilius’s picture

Thank you!

bevinlorenzo’s picture

Oh my gosh! I freakin love you Ronan! I have bee trying to figure this out all day! Send me paypal ID for reward!

ronan’s picture

Ha ha, glad I could help. No reward necessary.

All the best
R

dgorton’s picture

Status: Active » Closed (fixed)

Just cleaning