Does the Views-integration support block views?

kirilius - December 15, 2007 - 04:57
Project:Node Hierarchy
Version:5.x-1.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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!

#1

ronan - January 8, 2008 - 16:33

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:

<?php
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:

<?php

 
return array( 12345 );
?>

where 12345 is the node id

R

#2

kirilius - January 9, 2008 - 01:34

Thank you!

#3

bevinlorenzo - April 21, 2008 - 06:17

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

#4

ronan - April 22, 2008 - 19:27

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

All the best
R

#5

dgorton - June 19, 2008 - 12:46
Status:active» closed

Just cleaning

 
 

Drupal is a registered trademark of Dries Buytaert.