all_relationships; * * This variable is an array with two sub arrays with the keys 'object' and 'subject'. The array with * key 'object' contains relationships where the example is the object, and the array with * the key 'subject' contains relationships where the example is the subject */ $example = $variables['node']->example; $all_relationships = $example->all_relationships; $object_rels = $all_relationships['object']; $subject_rels = $all_relationships['subject']; if (count($object_rels) > 0 or count($subject_rels) > 0) { ?>
$rels){ foreach ($rels as $obj_type => $objects){ ?>This type_id->name;?> is  the following  example(s): record->object_id->title;
        if (property_exists($object->record, 'nid')) {
          $title = l($title, "node/" . $object->record->nid, array('attributes' => array('target' => "_blank")));
        }
        
        // get the citation
        $values = array(
          'example_id' => $object->record->object_id->example_id,
          'type_id' => array(
            'name' => 'Citation',
          ),
        );
        $citation = chado_generate_var('exampleprop', $values);
        $citation = chado_expand_var($citation, 'field', 'exampleprop.value');
        
        $rows[] = array(
          $title . '
' . htmlspecialchars($citation->value),
        ); 
       } 
       // the $table array contains the headers and rows array as well as other
       // options for controlling the display of the table.  Additional
       // documentation can be found here:
       // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
       $table = array(
         'header' => $headers,
         'rows' => $rows,
         'attributes' => array(
           'id' => 'tripal_example-table-relationship-object',
           'class' => 'tripal-data-table'
         ),
         'sticky' => FALSE,
         'caption' => '',
         'colgroups' => array(),
         'empty' => '',
       );
       
       // once we have our table array structure defined, we call Drupal's theme_table()
       // function to generate the table.
       print theme_table($table); ?>
       
The following record->subject_id->type_id->name ?> example(s) are  this type_id->name;?>: record->subject_id->title;
        if (property_exists($subject->record, 'nid')) {
          $title = l($title, "node/" . $subject->record->nid, array('attributes' => array('target' => "_blank")));
        }
        
        // get the citation
        $values = array(
          'example_id' => $subject->record->subject_id->example_id,
          'type_id' => array(
            'name' => 'Citation',
          ),
        );
        $citation = chado_generate_var('exampleprop', $values);
        $citation = chado_expand_var($citation, 'field', 'exampleprop.value');
        
        $rows[] = array(
          $title . '
' . htmlspecialchars($citation->value),
        );
       } 
       // the $table array contains the headers and rows array as well as other
       // options for controlling the display of the table.  Additional
       // documentation can be found here:
       // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
       $table = array(
         'header' => $headers,
         'rows' => $rows,
         'attributes' => array(
           'id' => 'tripal_example-table-relationship-subject',
           'class' => 'tripal-data-table'
         ),
         'sticky' => FALSE,
         'caption' => '',
         'colgroups' => array(),
         'empty' => '',
       );
       
       // once we have our table array structure defined, we call Drupal's theme_table()
       // function to generate the table.
       print theme_table($table); ?>