node--chado-generic.tpl.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. if($teaser) {
  3. print render($content);
  4. }
  5. else {
  6. $node_type = $node->type; ?>
  7. <script type="text/javascript">
  8. // we do not use Drupal Behaviors because we do not want this
  9. // code to be executed on AJAX callbacks. This code only needs to
  10. // be executed once the page is ready.
  11. jQuery(document).ready(function($){
  12. // hide all but the first data block
  13. $(".tripal-data-block").hide().filter(":first-child").show();
  14. // when a title in the table of contents is clicked, then
  15. // show the corresponding item in the details box
  16. $(".tripal_toc_list_item_link").click(function(){
  17. var id = $(this).attr('id') + "-tripal-data-block";
  18. $(".tripal-data-block").hide().filter("#"+ id).fadeIn('fast');
  19. return false;
  20. });
  21. // if a ?block= is specified in the URL then we want to show the
  22. // requested block
  23. var block = window.location.href.match(/[\?|\&]block=(.+?)[\&|\#]/)
  24. if(block == null){
  25. block = window.location.href.match(/[\?|\&]block=(.+)/)
  26. }
  27. if(block != null){
  28. $(".tripal-data-block").hide().filter("#" + block[1] + "-tripal-data-block").show();
  29. }
  30. // remove the 'active' class from the links section, as it doesn't
  31. // make sense for this layout
  32. $("a.active").removeClass('active');
  33. });
  34. </script>
  35. <div id="tripal_<?php print $node_type?>_contents" class="tripal-contents">
  36. <table id ="tripal-<?php print $node_type?>-contents-table" class="tripal-contents-table">
  37. <tr class="tripal-contents-table-tr">
  38. <td nowrap class="tripal-contents-table-td tripal-contents-table-td-toc" align="left"><?php
  39. // print the table of contents. It's found in the content array
  40. print $content['tripal_toc']['#markup'];
  41. // we may want to add the links portion of the contents to the sidebar
  42. //print render($content['links']);
  43. // remove the table of contents and links so thye doent show up in the
  44. // data section when the rest of the $content array is rendered
  45. unset($content['tripal_toc']);
  46. unset($content['links']); ?>
  47. </td>
  48. <td class="tripal-contents-table-td-data" align="left" width="100%"> <?php
  49. // print the rendered content
  50. print render($content); ?>
  51. </td>
  52. </tr>
  53. </table>
  54. </div> <?php
  55. }