root / drupal7 / modules / field / theme / field.tpl.php @ 76597ebf
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 |
* @ingroup themeable
|
45 |
*/
|
46 |
?>
|
47 |
<!--
|
48 |
THIS FILE IS NOT USED AND IS HERE AS A STARTING POINT FOR CUSTOMIZATION ONLY.
|
49 |
See http://api.drupal.org/api/function/theme_field/7 for details.
|
50 |
After copying this file to your theme's folder and customizing it, remove this
|
51 |
HTML comment.
|
52 |
-->
|
53 |
<div class="<?php print $classes; ?>"<?php print $attributes; ?>> |
54 |
<?php if (!$label_hidden): ?> |
55 |
<div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>: </div> |
56 |
<?php endif; ?> |
57 |
<div class="field-items"<?php print $content_attributes; ?>> |
58 |
<?php foreach ($items as $delta => $item): ?> |
59 |
<div class="field-item <?php print $delta % 2 ? 'odd' : 'even'; ?>"<?php print $item_attributes[$delta]; ?>><?php print render($item); ?></div> |
60 |
<?php endforeach; ?> |
61 |
</div>
|
62 |
</div>
|