incremental classes when grouping multiple cck values in views


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.