contextual-links-example-object.tpl.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation: Display a sample object with contextual links.
  5. *
  6. * Available variables:
  7. * - $title: The sanitized title of the object.
  8. * - $content: The sanitized content of the object.
  9. * These are defined in template_preprocess_contextual_links_example_object()
  10. * and represent whichever variables you might actually use to display the
  11. * main content of your module's object.
  12. *
  13. * Standard variables (required for contextual links):
  14. * - $classes: String of classes that can be used to style contextually through
  15. * CSS.
  16. * - $title_prefix (array): An array containing additional output populated by
  17. * modules, intended to be displayed in front of the main title tag that
  18. * appears in the template.
  19. * - $title_suffix (array): An array containing additional output populated by
  20. * modules, intended to be displayed after the main title tag that appears in
  21. * the template.
  22. * The above variables are a subset of those which Drupal provides to all
  23. * templates, and they must be printed in your template file in order for
  24. * contextual links to be properly attached. For example, the core Contextual
  25. * Links module adds the renderable contextual links themselves inside
  26. * $title_suffix, so they will appear immediately after the object's title in
  27. * the HTML. (This placement is for accessibility reasons, among others.)
  28. */
  29. ?>
  30. <div class="<?php print $classes; ?>">
  31. <?php print render($title_prefix); ?>
  32. <h2><?php print $title; ?></h2>
  33. <?php print render($title_suffix); ?>
  34. <?php print $content; ?>
  35. </div>