Home ›
Drupal template helpers to render values, including multivalue fieldsDrupal template helpers to render values, including multivalue fields
Submitted by Benjamin Melançon on October 27, 2010 - 12:16pm
Link Title and URL:
Drupal template helpers to render values, including multivalue fields <?php
function r_join($glue, $field, $value_type = 'view') {
foreach($field as $field_value) {
$values[] = $field_value[$value_type];
}
print join($glue, $values);
}
?>
Have to see if http://api.drupal.org/api/function/drupal_render/7 makes this fully or partially unnecessary in Drupal 7.
More like this
- Be sure to register templates moved to module layer, and moving functions from template.php to module
- Fix RSS output for CCK node types so that information from all important fields are included
- Functions needed to define a new CCK field; Field placement module thoughts
- The saga of changing a value of a field via a preprocess function, played out on IRC
- Use hook_theme for new theming functions and templates; use hook_theme_registry_alter to take over existing ones


Comments
Post new comment