Drupal & field-tpl for mulitple field rendering in a list


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

out put a field with multiple values as a list fro styling purposes useing child selectors


Copy this code and paste it in your HTML
  1. <div class="<?php print $classes; ?>"<?php print $attributes; ?>>
  2. <?php if (!$label_hidden): ?>
  3. <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
  4. <?php endif; ?>
  5. <ul class="field-items"<?php print $content_attributes; ?>>
  6. <?php foreach ($items as $delta => $item): ?>
  7. <li><?php print render($item); ?></li>
  8. <?php endforeach; ?>
  9. </div>
  10. </ul>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.