From 2729f1c2f0ae6aa790edf1a8be70a74fae04934c Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 11 Sep 2009 06:48:03 +0000 Subject: - Patch #569362 by scor, effulgentsia, catch: add attributes and title_attributes() variables for tpl files so that RDFa and Microformats can be implemented. --- modules/field/field.module | 16 ++++++++++++++++ modules/field/theme/field.tpl.php | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'modules/field') diff --git a/modules/field/field.module b/modules/field/field.module index 487ea3595..75dc3d431 100644 --- a/modules/field/field.module +++ b/modules/field/field.module @@ -756,8 +756,24 @@ function template_preprocess_field(&$variables) { ), ); $variables = array_merge($variables, $additions); + + // Initialize attributes for each item. + foreach ($variables['items'] as $delta => $item) { + $variables['item_attributes_array'][$delta] = array(); + } } +/** + * Theme process function for field.tpl.php. + * + * @see field.tpl.php + */ +function template_process_field(&$variables) { + // Flatten out attributes for each item. + foreach ($variables['items'] as $delta => $item) { + $variables['item_attributes'][$delta] = drupal_attributes($variables['item_attributes_array'][$delta]); + } +} /** * @} End of "defgroup field" */ diff --git a/modules/field/theme/field.tpl.php b/modules/field/theme/field.tpl.php index 9018f45b5..312c4b844 100644 --- a/modules/field/theme/field.tpl.php +++ b/modules/field/theme/field.tpl.php @@ -39,13 +39,13 @@ */ ?> -
+
> -
+
>
$item) : ?> -
+
>
-- cgit v1.2.3