Guest User

Untitled

a guest
May 24th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * @file field.tpl.php
  5. * Default template implementation to display the value of a field.
  6. *
  7. * This file is not used and is here as a starting point for customization only.
  8. * @see theme_field()
  9. *
  10. * Available variables:
  11. * - $items: An array of field values. Use render() to output them.
  12. * - $label: The item label.
  13. * - $label_hidden: Whether the label display is set to 'hidden'.
  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. The default values can be one or more of the
  17. * following:
  18. * - field: The current template type, i.e., "theming hook".
  19. * - field-name-[field_name]: The current field name. For example, if the
  20. * field name is "field_description" it would result in
  21. * "field-name-field-description".
  22. * - field-type-[field_type]: The current field type. For example, if the
  23. * field type is "text" it would result in "field-type-text".
  24. * - field-label-[label_display]: The current label position. For example, if
  25. * the label position is "above" it would result in "field-label-above".
  26. *
  27. * Other variables:
  28. * - $element['#object']: The entity to which the field is attached.
  29. * - $element['#view_mode']: View mode, e.g. 'full', 'teaser'...
  30. * - $element['#field_name']: The field name.
  31. * - $element['#field_type']: The field type.
  32. * - $element['#field_language']: The field language.
  33. * - $element['#field_translatable']: Whether the field is translatable or not.
  34. * - $element['#label_display']: Position of label display, inline, above, or
  35. * hidden.
  36. * - $field_name_css: The css-compatible field name.
  37. * - $field_type_css: The css-compatible field type.
  38. * - $classes_array: Array of html class attribute values. It is flattened
  39. * into a string within the variable $classes.
  40. *
  41. * @see template_preprocess_field()
  42. * @see theme_field()
  43. */
  44. ?>
  45. <div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  46. <?php if (!$label_hidden) : ?>
  47. <div class="field-label"<?php print $title_attributes; ?>><span><?php print $label ?></span></div>
  48. <?php endif; ?>
  49. <div class="field-items"<?php print $content_attributes; ?>>
  50. <?php foreach ($items as $delta => $item) : ?>
  51. <div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div>
  52. <?php endforeach; ?>
  53. </div>
  54. </div>
Add Comment
Please, Sign In to add comment