Bläddra i källkod

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

Stephen Ficklin 11 år sedan
förälder
incheckning
9e3ce4187b
1 ändrade filer med 18 tillägg och 0 borttagningar
  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),
        'template' => 'tripal_feature_sequence',
     ),
+    'tripal_feature_proteins' => array(
+       'arguments' => array('node' => NULL),
+       'template' => 'tripal_feature_proteins',
+    ),
     'tripal_feature_synonyms' => array(
        'arguments' => array('node' => NULL),
        '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);
   }
 }
+
+/**
+ *
+ *
+ * @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);
+  }
+}
 /**
  *
  *