Browse Source

Added template for showing proteins on feature pages if they have a relationship of 'derives_from'

Stephen Ficklin 11 năm trước cách đây
mục cha
commit
9e3ce4187b
1 tập tin đã thay đổi với 18 bổ sung0 xóa
  1. 18 0
      tripal_feature/tripal_feature.module

+ 18 - 0
tripal_feature/tripal_feature.module

@@ -285,6 +285,10 @@ function tripal_feature_theme() {
        'arguments' => array('node' => NULL),
        'arguments' => array('node' => NULL),
        'template' => 'tripal_feature_sequence',
        'template' => 'tripal_feature_sequence',
     ),
     ),
+    'tripal_feature_proteins' => array(
+       'arguments' => array('node' => NULL),
+       'template' => 'tripal_feature_proteins',
+    ),
     'tripal_feature_synonyms' => array(
     'tripal_feature_synonyms' => array(
        'arguments' => array('node' => NULL),
        'arguments' => array('node' => NULL),
        'template' => 'tripal_feature_synonyms',
        'template' => 'tripal_feature_synonyms',
@@ -1853,6 +1857,20 @@ function tripal_feature_preprocess_tripal_feature_relationships(&$variables) {
     $feature->all_relationships = tripal_feature_get_feature_relationships($feature);
     $feature->all_relationships = tripal_feature_get_feature_relationships($feature);
   }
   }
 }
 }
+
+/**
+ *
+ *
+ * @ingroup tripal_feature
+ */
+function tripal_feature_preprocess_tripal_feature_proteins(&$variables) {
+  // we want to provide a new variable that contains the matched features.
+  $feature = $variables['node']->feature;
+
+  if (!$feature->all_relationships) {
+    $feature->all_relationships = tripal_feature_get_feature_relationships($feature);
+  }
+}
 /**
 /**
  *
  *
  *
  *