1 | <?php |
---|
2 | |
---|
3 | /** |
---|
4 | * @file content-field.tpl.php |
---|
5 | * Default theme implementation to display the value of a field. |
---|
6 | * |
---|
7 | * Available variables: |
---|
8 | * - $node: The node object. |
---|
9 | * - $field: The field array. |
---|
10 | * - $items: An array of values for each item in the field array. |
---|
11 | * - $teaser: Whether this is displayed as a teaser. |
---|
12 | * - $page: Whether this is displayed as a page. |
---|
13 | * - $field_name: The field name. |
---|
14 | * - $field_type: The field type. |
---|
15 | * - $field_name_css: The css-compatible field name. |
---|
16 | * - $field_type_css: The css-compatible field type. |
---|
17 | * - $label: The item label. |
---|
18 | * - $label_display: Position of label display, inline, above, or hidden. |
---|
19 | * - $field_empty: Whether the field has any valid value. |
---|
20 | * |
---|
21 | * Each $item in $items contains: |
---|
22 | * - 'view' - the themed view for that item |
---|
23 | * |
---|
24 | * @see template_preprocess_content_field() |
---|
25 | */ |
---|
26 | ?> |
---|
27 | <?php if (!$field_empty) : ?> |
---|
28 | <div class="field field-type-<?php print $field_type_css ?> field-<?php print $field_name_css ?>"> |
---|
29 | <?php if ($label_display == 'above') : ?> |
---|
30 | <div class="field-label"><?php print t($label) ?>: </div> |
---|
31 | <?php endif;?> |
---|
32 | <div class="field-items"> |
---|
33 | <?php $count = 1; |
---|
34 | foreach ($items as $delta => $item) : |
---|
35 | if (!$item['empty']) : ?> |
---|
36 | <div class="field-item <?php print ($count % 2 ? 'odd' : 'even') ?>"> |
---|
37 | <?php if ($label_display == 'inline') { ?> |
---|
38 | <div class="field-label-inline<?php print($delta ? '' : '-first')?>"> |
---|
39 | <?php print t($label) ?>: </div> |
---|
40 | <?php } ?> |
---|
41 | <?php print $item['view'] ?> |
---|
42 | </div> |
---|
43 | <?php $count++; |
---|
44 | endif; |
---|
45 | endforeach;?> |
---|
46 | </div> |
---|
47 | </div> |
---|
48 | <?php endif; ?> |
---|