You are here

function nodehierarchy_views_prepare_node in Node Hierarchy 7.2

Same name and namespace in other branches
  1. 6.3 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_prepare_node()
  2. 6.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_prepare_node()
  3. 7.4 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_prepare_node()

Set a default embedded view.

1 call to nodehierarchy_views_prepare_node()
nodehierarchy_views_node_prepare in nodehierarchy_views/nodehierarchy_views.module
Implements hook_node_prepare().

File

nodehierarchy_views/nodehierarchy_views.module, line 170
Embed a view of children onto a node.

Code

function nodehierarchy_views_prepare_node(&$node) {

  // Set the default children view if there is one for this type and if the node has not been saved yet.
  if (empty($node->nid) && empty($node->nh_children_view) && ($children_view = variable_get('nh_default_children_view_' . $node->type, NULL))) {
    list($node->nh_children_view, $node->nh_children_display) = explode(':', $children_view);
  }
}