You are here

function nodehierarchy_views_load_node in Node Hierarchy 7.4

Same name and namespace in other branches
  1. 5 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_load_node()
  2. 6.3 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_load_node()
  3. 6 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_load_node()
  4. 6.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_load_node()
  5. 7.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_load_node()

Implements hook_load().

1 call to nodehierarchy_views_load_node()
nodehierarchy_views_node_load in nodehierarchy_views/nodehierarchy_views.module
Implements hook_node_load().

File

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

Code

function nodehierarchy_views_load_node($nodes) {
  foreach ($nodes as $node) {
    if ($results = db_query('SELECT nh_children_view, nh_children_view_display FROM {nodehierarchy_views} WHERE nid = :nid', array(
      ':nid' => $node->nid,
    ))
      ->fetchObject()) {
      $node->nh_children_view = $results->nh_children_view;
      $node->nh_children_view_display = $results->nh_children_view_display;
    }
  }
}