Skip to content

Instantly share code, notes, and snippets.

@waako
Created November 8, 2012 17:04
Show Gist options
  • Save waako/4040102 to your computer and use it in GitHub Desktop.
Save waako/4040102 to your computer and use it in GitHub Desktop.
Output all field values into a single unordered list
// Prepare a renderable array to hold items.
$variables['planning'] = array(
'#theme' => 'item_list',
'#items' => array(),
);
// Add the term as a new renderable item in the list.
foreach(($variables['field_planning'] + $variables['field_diet'] + $variables['field_healthy']) as $taxon_term_field) {
$term_name = $taxon_term_field['taxonomy_term']->name;
$variables['planning']['#items'][] = $term_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment