I don't know if this is possible but is there a possibility of having 'no wrapper' but the class still applied to the item element itself?

eg. for an image field instead of
<div class='field-image'><img src='...'></div>
you could have
<img class='field-image' src='...'>

Is this possible or is it outside the scope of this module?

Comments

gregsmith’s picture

You can of course do this easily by overriding field--fences-no-wrapper.tpl.php

and changing:

<?php foreach ($items as $delta => $item): ?>
  <?php print render($item); ?>
<?php endforeach; ?>

to:

<?php foreach ($items as $delta => $item): ?>
  <?php $item['#item']['attributes']['class'] = $classes; ?>
  <?php print render($item); ?>
<?php endforeach; ?>
Fabianx’s picture

Category: Feature request » Support request
Status: Active » Fixed

Seems this solution should work well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.