Hi all

Having a small issue trying to add a class onto an existing div wrapper outputted from the field_collection module.

<div class="field-collection-container">
  <div class="field-name-job-photos">
    <div class="field-items">

I would like to add a class onto:<div class="field-items">

So I have something like:<div class="field-items extra-class">

Can anybody help, how would I go about doing this?

Thanks, Barry

Comments

jaffaralia’s picture

you can use theme_field() function in template.php file on your custom theme

https://api.drupal.org/api/drupal/modules%21field%21field.module/functio...

computerbarry’s picture

Perfect! Thanks.

I've used this approach in the past, been a while :)

I've created a tpl file and customised, if anybody interested:

<div class="field-items carousel"<?php print $content_attributes; ?>>
      <?php foreach ($items as $item): ?>
        <div class="field-item"><?php print render($item); ?></div>
      <?php endforeach; ?>
    </div>

Barry

The more you learn.... the more you learn there is more to learn.