I have a content type (called Gallery) with a image field (called field_gallery) which allows to upload and show 10 images.

Now I create a node and upload the images. The output shows those images wrapped with a div tag. Like:

<div class="field-item even"> <img …. /> </div>
<div class="field-item odd"> <img …. /> </div>
<div class="field-item even"> <img …. /> </div>

Instead of this I need it to be something like:

<img class="field-item even"  …. /> 
<img class="field-item odd"  …. /> 
<img class="field-item even"  …. />

How can I accomplish this. Should I use an alter function? How? thanks

  • Probably you want to implement some carousel or slider? Have you check if it works in this formate. Oct 17, 2011 at 19:01

1 Answer 1

  1. You can overwrite the field output template, e.g. field--field-name.tpl.php, or a module template, if that's the case. See http://drupal.org/node/1089656.
  2. You can overwrite the node template for this content type (node--type.tpl.php). Type in <pre><?php print_r($node); ?></pre> to find the element you want. For template information, see http://drupal.org/node/1089656.
  3. You can create a page in Views.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.