colorbox-insert-image.tpl.php 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * @file
  4. * Template file for Colorbox content inserted via the Insert module.
  5. *
  6. * Available variables:
  7. * - $item: The complete item being inserted.
  8. * - $url: The URL to the image.
  9. * - $path: The URL to the image that Colorbox should open.
  10. * - $class: A set of classes assigned to this image (if any).
  11. * - $width: The width of the image (if known).
  12. * - $height: The height of the image (if known).
  13. * - $style_name: The Image style being used.
  14. * - $gallery_id: The ID of the Colorbox gallery.
  15. *
  16. * Note that ALT and Title fields should not be filled in here, instead they
  17. * should use placeholders that will be updated through JavaScript when the
  18. * image is inserted.
  19. *
  20. * Available placeholders:
  21. * - __alt__: The ALT text, intended for use in the <img> tag.
  22. * - __title__: The Title text, intended for use in the <img> tag.
  23. * - __description__: A description of the image, sometimes used as a caption.
  24. * - __filename__: The file name.
  25. * - __[token]_or_filename__: Any of the above tokens if available, otherwise
  26. * use the file's name. i.e. __title_or_filename__.
  27. */
  28. ?>
  29. <a href="<?php print $path; ?>" title="__title__" class="colorbox colorbox-insert-image" data-colorbox-gallery="<?php print $gallery_id; ?>">
  30. <img src="<?php print $url; ?>" <?php if ($width && $height): ?>width="<?php print $width; ?>" height="<?php print $height; ?>" <?php endif; ?>alt="__alt__" title="__title__" class="<?php print $class; ?>" />
  31. </a>