tripal_library_teaser.tpl.php 837 B

123456789101112131415161718192021222324252627
  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>