node--chado-stock.tpl.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. // Purpose: This template provides the layout of the stock node (page)
  3. // using the same templates used for the various stock content blocks.
  4. //
  5. // To Customize the Stock Node Page:
  6. // - This Template: customize basic layout and which elements are included
  7. // - Using Panels: Override the node page using Panels3 and place the blocks
  8. // of content as you please. This method requires no programming. See
  9. // the Tripal User Guide for more details
  10. // - Block Templates: customize the content/layout of each block of stock
  11. // content. These templates are found in the tripal_stock subdirectory
  12. //
  13. // Variables Available:
  14. // - $node: a standard object which contains all the fields associated with
  15. // nodes including nid, type, title, taxonomy. It also includes stock
  16. // specific fields such as stock_name, uniquename, stock_type, synonyms,
  17. // properties, db_references, object_relationships, subject_relationships,
  18. // organism, etc.
  19. // NOTE: For a full listing of fields available in the node object the
  20. // print_r $node line below or install the Drupal Devel module which
  21. // provides an extra tab at the top of the node page labelled Devel
  22. $stock = $variables['node']->stock;
  23. // get the template settings
  24. $template_settings = theme_get_setting('tripal');
  25. // toggle the sidebar if desired
  26. $no_sidebar = 0;
  27. if (is_array($template_settings['tripal_no_sidebar']) and
  28. $template_settings['tripal_no_sidebar']['stock']) {
  29. $no_sidebar = 1;
  30. }
  31. if ($teaser) {
  32. //print theme('tripal_stock_teaser',$node);
  33. }
  34. else { ?>
  35. <div id="tripal_stock_details" class="tripal_details">
  36. <!-- Base Theme -->
  37. <?php //print theme('tripal_stock_base',$node); ?>
  38. <!-- Cross References -->
  39. <?php //print theme('tripal_stock_references',$node); ?>
  40. <!-- Properties -->
  41. <?php //print theme('tripal_stock_properties',$node); ?>
  42. <!-- Synonyms -->
  43. <?php //print theme('tripal_stock_synonyms',$node); ?>
  44. <!-- Relationships -->
  45. <?php //print theme('tripal_stock_relationships',$node); ?>
  46. <!-- Stock Collections -->
  47. <?php //print theme('tripal_stock_collections',$node); ?>
  48. <!-- Stock Genotypes -->
  49. <?php //print theme('tripal_stock_genotypes',$node); ?>
  50. <!-- Resource Blocks CCK elements --><?php
  51. /**
  52. for($i = 0; $i < count($node->field_resource_titles); $i++){
  53. if($node->field_resource_titles[$i]['value']){ ?>
  54. <div id="tripal_stock-resource_<?php print $i?>-box" class="tripal_stock-info-box tripal-info-box">
  55. <div class="tripal_stock-info-box-title tripal-info-box-title"><?php print $node->field_resource_titles[$i]['value'] ?></div>
  56. <?php print $node->field_resource_blocks[$i]['value']; ?>
  57. </div><?php
  58. }
  59. }*/?>
  60. <!-- Let modules add more content -->
  61. <?php print $content; ?>
  62. </div>
  63. <!-- Table of contents -->
  64. <div id="tripal_stock_toc" class="tripal_toc">
  65. <div id="tripal_stock_toc_title" class="tripal_toc_title">Resources</div>
  66. <span id="tripal_stock_toc_desc" class="tripal_toc_desc"></span>
  67. <ul id="tripal_stock_toc_list" class="tripal_toc_list">
  68. <!-- Resource Links CCK elements --><?php
  69. /**
  70. for($i = 0; $i < count($node->field_resource_links); $i++){
  71. if($node->field_resource_links[$i]['value']){
  72. $matches = preg_split("/\|/",$node->field_resource_links[$i]['value']);?>
  73. <li><a href="<?php print $matches[1] ?>" target="_blank"><?php print $matches[0] ?></a></li><?php
  74. }
  75. }*/?>
  76. <?php // ADD CUSTOMIZED <li> LINKS HERE ?>
  77. </ul>
  78. </div>
  79. <?php } ?>