node-chado_feature.tpl.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. // Purpose: This template provides the layout of the feature node (page)
  3. // using the same templates used for the various feature content blocks.
  4. //
  5. // To Customize the Featture 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. ?>
  23. <?php
  24. //uncomment this line to see a full listing of the fields avail. to $node
  25. //print '<pre>'.print_r($variables,TRUE).'</pre>';
  26. drupal_add_css('./tripal-node-templates.css');
  27. $feature = $variables['node']->feature;
  28. ?>
  29. <?php if ($teaser) {
  30. include('tripal_feature/tripal_feature_teaser.tpl.php');
  31. } else { ?>
  32. <script type="text/javascript">
  33. if (Drupal.jsEnabled) {
  34. $(document).ready(function() {
  35. // hide all tripal info boxes at the start
  36. $(".tripal-info-box").hide();
  37. // iterate through all of the info boxes and add their titles
  38. // to the table of contents
  39. $(".tripal-info-box-title").each(function(){
  40. var parent = $(this).parent();
  41. var id = $(parent).attr('id');
  42. var title = $(this).text();
  43. $('#tripal_feature_toc_list').append('<li><a href="#'+id+'" class="tripal_feature_toc_item">'+title+'</a></li>');
  44. });
  45. // when a title in the table of contents is clicked, then
  46. // show the corresponding item in the details box
  47. $(".tripal_feature_toc_item").click(function(){
  48. $(".tripal-info-box").hide();
  49. href = $(this).attr('href');
  50. $(href).fadeIn('slow');
  51. // we want to make sure our table of contents and the details
  52. // box stay the same height
  53. $("#tripal_feature_toc").height($(href).parent().height());
  54. return false;
  55. });
  56. // we want the base details to show up when the page is first shown
  57. // unless the user specified a specific block
  58. var block = window.location.href.match(/\?block=.*/);
  59. if(block != null){
  60. block_title = block.toString().replace(/\?block=/g,'');
  61. $("#tripal_feature-"+block_title+"-box").show();
  62. } else {
  63. $("#tripal_feature-base-box").show();
  64. }
  65. $("#tripal_organism_toc").height($("#tripal_feature-base-box").parent().height());
  66. });
  67. }
  68. </script>
  69. <div id="tripal_feature_details" class="tripal_details">
  70. <!-- Basic Details Theme -->
  71. <?php include('tripal_feature/tripal_feature_base.tpl.php'); ?>
  72. <!-- Database References -->
  73. <?php include('tripal_feature/tripal_feature_references.tpl.php'); ?>
  74. <!-- Properties -->
  75. <?php include('tripal_feature/tripal_feature_properties.tpl.php'); ?>
  76. <!-- Synonyms -->
  77. <?php include('tripal_feature/tripal_feature_synonyms.tpl.php'); ?>
  78. <!-- Sequence -->
  79. <?php include('tripal_feature/tripal_feature_sequence.tpl.php'); ?>
  80. <!-- Formatted Sequences -->
  81. <?php include('tripal_feature/tripal_feature_featureloc_sequences.tpl.php'); ?>
  82. <!-- Object Relationships -->
  83. <?php include('tripal_feature/tripal_feature_relationships_as_object.tpl.php'); ?>
  84. <!-- Subject Relationships -->
  85. <?php include('tripal_feature/tripal_feature_relationships_as_subject.tpl.php'); ?>
  86. <!-- Feature locations as Child -->
  87. <?php include('tripal_feature/tripal_feature_featurelocs_as_child.tpl.php'); ?>
  88. <!-- Subject Relationships -->
  89. <?php include('tripal_feature/tripal_feature_featurelocs_as_parent.tpl.php'); ?>
  90. <?php print $content ?>
  91. </div>
  92. <!-- Table of contents -->
  93. <div id="tripal_feature_toc" class="tripal_toc">
  94. <div id="tripal_feature_toc_title" class="tripal_toc_title">Resources for <?php print $feature->cvname?><br><?php print $feature->featurename ?></div>
  95. <span id="tripal_feature_toc_desc" class="tripal_toc_desc">Select a link below for more information</span>
  96. <ul id="tripal_feature_toc_list" class="tripal_toc_list">
  97. </ul>
  98. </div>
  99. <?php } ?>