entity.tpl.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation for entities.
  5. *
  6. * Available variables:
  7. * - $content: An array of comment items. Use render($content) to print them all, or
  8. * print a subset such as render($content['field_example']). Use
  9. * hide($content['field_example']) to temporarily suppress the printing of a
  10. * given element.
  11. * - $title: The (sanitized) entity label.
  12. * - $url: Direct url of the current entity if specified.
  13. * - $page: Flag for the full page state.
  14. * - $classes: String of classes that can be used to style contextually through
  15. * CSS. It can be manipulated through the variable $classes_array from
  16. * preprocess functions. By default the following classes are available, where
  17. * the parts enclosed by {} are replaced by the appropriate values:
  18. * - entity-{ENTITY_TYPE}
  19. * - {ENTITY_TYPE}-{BUNDLE}
  20. *
  21. * Other variables:
  22. * - $classes_array: Array of html class attribute values. It is flattened
  23. * into a string within the variable $classes.
  24. *
  25. * @see template_preprocess()
  26. * @see template_preprocess_entity()
  27. * @see template_process()
  28. */
  29. ?>
  30. <div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  31. <?php if (!$page): ?>
  32. <h2<?php print $title_attributes; ?>>
  33. <?php if ($url): ?>
  34. <a href="<?php print $url; ?>"><?php print $title; ?></a>
  35. <?php else: ?>
  36. <?php print $title; ?>
  37. <?php endif; ?>
  38. </h2>
  39. <?php endif; ?>
  40. <div class="content"<?php print $content_attributes; ?>>
  41. <?php
  42. print render($content);
  43. ?>
  44. </div>
  45. </div>