I have 3 image fields in a content type: img1,img2 and img3. img3 is multi valued while the rest are single valued, and I'd like to create a single slideshow containing img1, img2 and img3 to be showed on every node of that content type.

I tried using views slideshow with as block with contextual filters and managed to select images from a node correctly, but they weren't displayed properly as a slideshow.

The reason I'm not simply using one image field to make things easier is that I'm using the Custom Formatters module and I have problems with using just one field with that module:

Custom formatter for a multi-valued field


2 Answers 2

  <?php if ( ($image_slide == 'true') ): ?>
        <div class="image-post-slider">
                <?php while ($img_count < $counter) { ?>
                          <div class="preloader">
                                <a class="bwWrapper single-image link-icon" href="<?php print $node_url; ?>">
                                    <img src="<?php echo file_create_url($node->field_image['und'][$img_count]['uri']); ?>" alt="" >
                  <?php $img_count++; } ?>      
        <?php endif; ?>

Put something like above snippet in your node.tpl.php This will create links of images and their links if any. Then apply normal css/js to make it in slideshow

  • thanks, but I need a slideshow that combines several fields, not just one field.
    – ashash
    Oct 28, 2014 at 6:08
  • Just loop through all images like this <?php for($i=0; $i < count($node->field_image['und']); $i++){ <img src="<?php echo file_create_url($node->field_image['und'][$i]['uri']); ?>" alt="" > } for($j=0; $j < count($node->field_other_image['und']); $j++){ <img src="<?php echo file_create_url($node->field_other_image['und'][$j]['uri']); ?>" alt="" > } ?> and follow @Shabir's advice for the css/js. Oct 28, 2014 at 11:00

Try the Jcarousel module.

This module allows developers and themers to make use of the jCarousel jQuery plugin. It includes a developer API that other modules can use, as well as Views integration in the 2.0 version so that you can turn any list of content or images into a carousel.

Image from project page

enter image description here

If you want to add additional features have a look at Views Slideshow JCarousel

Integrates JCarousel features into views slideshow version 6.x-3.x or 7.x. Currently provides a JCarousel pager widget.

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.