--- nodehierarchy_views.module-old 2009-07-13 14:52:32.000000000 -0700 +++ nodehierarchy_views.module 2009-07-13 15:56:08.000000000 -0700 @@ -165,9 +165,12 @@ function nodehierarchy_views_embed_child // caution. $view->url = "node"; + // Get field weights + $field_weights = variable_get('content_extra_weights_' . $node->type, 10); + $node->content['nodehierarchy_children'] = array( "#value" => $view->execute_display('default', $arguments), - "#weight" => 10 + "#weight" => $field_weights['nodehierarchy_views'] ? $field_weights['nodehierarchy_views'] : 10, ); } } @@ -186,3 +189,21 @@ function _nodehierarchy_views_view_optio return $options; } + +/** + * hook_content_extra_fields + * + * Provides form field for changing weight of inserted view + */ +function nodehierarchy_views_content_extra_fields($type_name) { + + if(variable_get('nh_default_children_view_' . $type_name, FALSE)) { + $extra['nodehierarchy_views'] = array( + 'label' => t('Nodehierarchy Views'), + 'description' => t('nodehierarchy_views.module output.'), + 'weight' => 10, + ); + } + + return $extra; +}