diff options
Diffstat (limited to 'modules/field/theme')
-rw-r--r-- | modules/field/theme/field.css | 30 | ||||
-rw-r--r-- | modules/field/theme/field.tpl.php | 49 |
2 files changed, 79 insertions, 0 deletions
diff --git a/modules/field/theme/field.css b/modules/field/theme/field.css new file mode 100644 index 000000000..57eb97105 --- /dev/null +++ b/modules/field/theme/field.css @@ -0,0 +1,30 @@ +/* Node display */ +.field .field-label, +.field .field-label-inline, +.field .field-label-inline-first { + font-weight:bold; +} +.field .field-label-inline, +.field .field-label-inline-first { + display:inline; +} +.field .field-label-inline { + visibility:hidden; +} + +.node-form .field-multiple-table td.field-multiple-drag { + width:30px; + padding-right:0; +} +.node-form .field-multiple-table td.field-multiple-drag a.tabledrag-handle{ + padding-right:.5em; +} + +.node-form .field-add-more .form-submit{ + margin:0; +} + +.node-form .number { + display:inline; + width:auto; +}
\ No newline at end of file diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php new file mode 100644 index 000000000..ccab1f791 --- /dev/null +++ b/modules/field/theme/field.tpl.php @@ -0,0 +1,49 @@ +<?php +// $Id$ + +/** + * @file field-field.tpl.php + * Default theme implementation to display the value of a field. + * + * Available variables: + * - $node: The node object. + * - $field: The field array. + * - $items: An array of values for each item in the field array. + * - $teaser: Whether this is displayed as a teaser. + * - $page: Whether this is displayed as a page. + * - $field_name: The field name. + * - $field_type: The field type. + * - $field_name_css: The css-compatible field name. + * - $field_type_css: The css-compatible field type. + * - $label: The item label. + * - $label_display: Position of label display, inline, above, or hidden. + * - $field_empty: Whether the field has any valid value. + * + * Each $item in $items contains: + * - 'view' - the themed view for that item + * + * @see template_preprocess_field() + */ +?> +<?php if (!$field_empty) : ?> +<div class="field field-type-<?php print $field_type_css ?> field-<?php print $field_name_css ?>"> + <?php if ($label_display == 'above') : ?> + <div class="field-label"><?php print t($label) ?>: </div> + <?php endif;?> + <div class="field-items"> + <?php $count = 1; + foreach ($items as $delta => $item) : + if (!$item['empty']) : ?> + <div class="field-item <?php print ($count % 2 ? 'odd' : 'even') ?>"> + <?php if ($label_display == 'inline') { ?> + <div class="field-label-inline<?php print($delta ? '' : '-first')?>"> + <?php print t($label) ?>: </div> + <?php } ?> + <?php print $item['view'] ?> + </div> + <?php $count++; + endif; + endforeach;?> + </div> +</div> +<?php endif; ?> |