Posted By

canarymason on 08/31/09


Tagged

drupal views cck 6


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

ReeceMarsland
umang_nine
dividespace


incremental classes when grouping multiple cck values in views


 / Published in: PHP
 

  1. function THEMENAME_content_view_multiple_field($items, $field, $values) {
  2. $output = '';
  3. foreach ($items as $index => $item) {
  4. if (!empty($item) || $item == '0') {
  5. $classes = 'field-item';
  6. $classes .= ' field-item-'. ($index+1);
  7. $output .= '<div class="'. $classes .'">'. $item .'</div>';
  8. }
  9. }
  10. return $output;
  11. }

Report this snippet  

You need to login to post a comment.