You are here

function nodehierarchy_views_field_extra_fields in Node Hierarchy 7.2

Same name and namespace in other branches
  1. 7.4 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_field_extra_fields()

Implements hook_content_extra_fields().

File

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

Code

function nodehierarchy_views_field_extra_fields() {
  $extra = array();
  foreach (node_type_get_names() as $type => $name) {
    if (nodehierarchy_node_can_be_parent($type)) {
      $extra['node'][$type] = array(
        'display' => array(
          'nodehierarchy_children' => array(
            'label' => t('Node Hierarchy Children'),
            'description' => t('Node Hierarchy embedded children view.'),
            'weight' => 10,
          ),
          'nodehierarchy_children_links' => array(
            'label' => t('Node Hierarchy Add Child Links'),
            'description' => t('Links to create a new child.'),
            'weight' => 11,
          ),
        ),
      );
    }
  }
  return $extra;
}