--- nodehierarchy_views.module-old	2009-07-13 14:52:32.000000000 -0700
+++ nodehierarchy_views.module	2009-07-13 14:50:35.000000000 -0700
@@ -164,10 +164,13 @@ function nodehierarchy_views_embed_child
     // be taking advantage of a non-api side effect and should be treated with
     // 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'],
     );
   }
 }
@@ -186,3 +189,23 @@ 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) {
+  
+  $view = variable_get('nh_default_children_view_' . $type_name, '');
+  
+  if($view != '') {
+    $extra['nodehierarchy_views'] = array(
+      'label' => 'Nodehierarchy Views',
+      'description' => t('Nodehierarchy views output.'),
+      'weight' => 10,
+    );
+  }
+  
+  return $extra;
+}
