tripal_library_teaser.tpl.php

  1. 2.x tripal_library/theme/templates/tripal_library_teaser.tpl.php
  2. 3.x legacy/tripal_library/theme/templates/tripal_library_teaser.tpl.php
1 theme call to tripal_library_teaser.tpl.php
tripal_library_node_view in tripal_library/includes/tripal_library.chado_node.inc
Implements hook_node_view(). Acts on all content types

File

tripal_library/theme/templates/tripal_library_teaser.tpl.php
View source
  1. <?php
  2. $node = $variables['node'];
  3. $library = $variables['node']->library;
  4. // get the library description. IT uses a tern name of 'Library Description'
  5. $record = array(
  6. 'table' => 'library',
  7. 'id' => $library->library_id
  8. );
  9. $property = array(
  10. 'type_name' => 'Library Description',
  11. 'cv_name' => 'library_property'
  12. );
  13. $libprop = chado_get_property($record, $property);
  14. $description = $libprop->value; ?>
  15. <div class="tripal_library-teaser tripal-teaser">
  16. <div class="tripal-library-teaser-title tripal-teaser-title"><?php
  17. print l($node->title, "node/$node->nid", array('html' => TRUE));?>
  18. </div>
  19. <div class="tripal-library-teaser-text tripal-teaser-text"><?php
  20. print substr($description, 0, 650);
  21. if (strlen($description) > 650) {
  22. print "... " . l("[more]", "node/$node->nid");
  23. } ?>
  24. </div>
  25. </div>