From 45e14ea6b707ce3752692c6b524d5e6e8d7717e5 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 28 Aug 2009 06:51:07 +0000 Subject: - Patch #545662 by yched, moshe weitzman: simplify field rendering. --- modules/field/theme/field.css | 14 ++++------ modules/field/theme/field.tpl.php | 59 ++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 38 deletions(-) (limited to 'modules/field/theme') diff --git a/modules/field/theme/field.css b/modules/field/theme/field.css index 93dcbcb08..fb4bcc439 100644 --- a/modules/field/theme/field.css +++ b/modules/field/theme/field.css @@ -1,19 +1,15 @@ /* $Id$ */ /* Field display */ -.field .field-label, -.field .field-label-inline, -.field .field-label-inline-first { +.field .field-label { font-weight: bold; } -.field .field-label-inline, -.field .field-label-inline-first { - display: inline; -} -.field .field-label-inline { - visibility: hidden; +.field-label-inline .field-label, +.field-label-inline .field-items { + float:left; } +/* Form display */ form .field-multiple-table { margin: 0; } diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php index d58ff1637..9018f45b5 100644 --- a/modules/field/theme/field.tpl.php +++ b/modules/field/theme/field.tpl.php @@ -2,50 +2,51 @@ // $Id$ /** - * @file field-field.tpl.php + * @file field.tpl.php * Default theme implementation to display the value of a field. * * Available variables: + * - $items: An array of field values. Use render() to output them. + * - $label: The item label. + * - $label_hidden: Whether the label display is set to 'hidden'. + * - $classes: String of classes that can be used to style contextually through + * CSS. It can be manipulated through the variable $classes_array from + * preprocess functions. The default values can be one or more of the + * following: + * - field-name-[field_name]: The current field name. For example, if the + * field name is "field_description" it would result in + * "field-name-field-description". + * - field-type-[field_type]: The current field type. For example, if the + * field type is "text" it would result in "field-type-text". + * - field-label-[label_display]: The current label position. For example, if the + * label position is "above" it would result in "field-label-above". + * + * Other variables: * - $object: The object to which the field is attached. * - $field: The field array. - * - $items: An array of values for each item in the field array. * - $build_mode: Build mode, e.g. 'full', '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. * - $field_language: The field language. * - $field_translatable: Whether the field is translatable or not. - * - * Each $item in $items contains: - * - 'view' - the themed view for that item + * - $label_display: Position of label display, inline, above, or hidden. + * - $classes_array: Array of html class attribute values. It is flattened + * into a string within the variable $classes. * * @see template_preprocess_field() */ ?> - -
- -
- -
- $item) : - if (!$item['empty']) : ?> -
- -
-
- - -
- + +
+ +
+ +
+ $item) : ?> +
+ +
-
-- cgit v1.2.3