1

I want to show up to 3 images in my teasers. For that I override the field--field-image.tpl file in my theme directory and it works perfectly.

<?php

if ($element['#view_mode'] == 'teaser') {
    $items = array(array_slice($items, 0,3));
    }

    print "<div class=\"gallery-thumbs\">".render($items)."</div>";
?>

I would like to use a Display Suite layout instead for the teaser, but the field--field-image.tpl has no effect anymore. Where should I put this code to achieve the same effect (up to 3 thumbnails) using a Display Suite layout?

1 Answer 1

2

I am a little bit ashamed, but if the issue occurs to someone else, it is not even necessary to write code. There is a dedicated field in the manage display interface.

enter image description here

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.