Closed (fixed)
Project:
Node Hierarchy
Version:
6.x-1.0
Component:
Drupal/PHP Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jul 2008 at 12:25 UTC
Updated:
1 Sep 2011 at 16:14 UTC
When using "Embed Children View:" with "nodehierarchy_children_list" in a Page, the view works perfectly.
If I however create a "Block Display" within the nodehierarchy_children_list View Settings and try to set it as a block (right side), it doesn't work at all.
Duplicating nodehierarchy_children_list isn't working too.
Comments
Comment #1
ronan commentedThat's because views in blocks do not have any context as to what page they are on (or even if they're on a node page). The view cannot therefore tell which node to use as a parent for that block.
This can be worked around by putting this snippet in your view's argument handler php section:
Hope this helps
Ronan
Comment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #3
leisurman commentedCan I open this topic up again? THe code above isnt working. I would like to use the nodehierarchy_children_list in a block and list the children of the current node. I dont want to use menu block because some of the children are not menu items.
How can you make a block know what node it is on? What is the php code?
Thank you
Comment #4
leisurman commentedSorry it did work- i forgot to leave off the opening php tag so you only need
if (arg(0) == 'node' && is_numeric(arg(1))) {
return array(arg(1));
}
?>