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