Posted By

discipolo on 05/31/10


Tagged

drupal templatephp


Versions (?)

function TF2007Theme_content_view_multiple_field


 / Published in: PHP
 

URL: http://drupalcontrib.org/api/function/theme_content_view_multiple_field

change the display of cck grouped terms to implode (commas, no divs) for a cerain field only

  1. /**
  2. * remove divs from multiple fields when grouping terms
  3. *
  4. */
  5. //this might cause errors cause we only want to avoid them for the speaker field. also this should be changed to an implode to get the list right
  6.  
  7. function MYtheme_content_view_multiple_field($items, $field, $values) {
  8. if
  9. ($field['field_name'] == 'field_speaker'){
  10. $output = implode(',', $items);
  11. return $output;}
  12.  
  13. else {$output = '';
  14. $i = 0;
  15. foreach ($items as $item) {
  16. if (!empty($item) || $item == '0') {
  17. $output .= '<p class="field-item field-item-'. $i .'">'. $item .'</p>';
  18. $i++;
  19. }
  20. }
  21. return $output;}
  22. }

Report this snippet  

You need to login to post a comment.