Home page carousel

Carousels are a method of displaying information on a homepage as a banner image .In this post we have mentioned that carousel is only working, if more than 2 banner images, other wise it is just still full size image without carousel.

var carouselDetails = SC.CONFIGURATION.get('homecarousel.carouselImages');
carouselDetails[0].target = "_blank";
return {
showcarousel:carouselDetails.length>1 ? true : false
}

On template we have to Check number of images greater than or equal to one or not

{{#if showcarousel}}
 <ul data-slider >
<li>//Images</li>
</ul>
{{else}}
 <ul>
<li>//Image</li>
</ul>
{{/if}}

Leave a comment

Your email address will not be published. Required fields are marked *