Custom Carousel/Slider component using Sightly | Community
Skip to main content
au4liferz
New Participant
October 16, 2015
Solved

Custom Carousel/Slider component using Sightly

  • October 16, 2015
  • 14 replies
  • 8850 views

I have a requirement to develop a custom carousel using Sightly, but there really isn't a lot of documentation out there, and I'm not sure where to start, or exactly how to go about it. There are several good javascript carousel/slider components, and I'm wondering if I should try to use one of them, or simply develop it from scratch using Java/JSP. If anyone can summarize the steps, provide tutorials orany other links and material you can share, it would be greatly appreciated. The most important thing is to develop this component in a manner that embodies best practices such as a good separation of presentation and business logic, (MVC'ish architecture), and loose coupling from a styling perspective.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Lokesh_Shivalingaiah

Refer [1] to create a sightly template and read values from the dialog 

[1] https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html

Refer [2] for multiple taglibs available in Sightly. It helps you to in #2 to loop through all the images and create div

[2] https://docs.adobe.com/docs/en/aem/6-0/develop/sightly.html

For #3, once you have read the values and created div, apply JS to get the carousel running.

14 replies

New Participant
June 5, 2018

But i was wondering how to make We.retail or OOTB carousel component work ?
can it  be made work , is there any documentation for the same ?

smacdonald2008
New Participant
June 4, 2018

Using Bootstrap carousel component works nicely in AEM: https://getbootstrap.com/docs/4.0/components/carousel/

New Participant
June 4, 2018

Is there any OOTB working carousel component present in AEM which we could leverage ?
i did found carousel component present in We.Retail , but on using that component , it wasn't working as i expected to work.
Could you confirm, whether its working or not ? 

smacdonald2008
New Participant
October 16, 2015

Can I ask why use Sightly - not JSP? 

There are a lot of good plug-ins available that will let you use JS libs to achieve this use case. For example: 

https://helpx.adobe.com/experience-manager/using/custom-carousel-components.html

edubey
New Participant
October 16, 2015

Hi, 

This is simple, no need to get too much serious

1. First, With any slider / carousel available on internet, you get HTML + CSS + JS, get all these 3 thing and put in your code. Simple one is here @ http://www.w3schools.com/bootstrap/bootstrap_carousel.asp

2. Make a dialog where user can author these images and captions.

Feike_Visser1
Employee
October 16, 2015

I would normally start with the HTML/markup, and then adding logic where needed.\

When using Sightly the logic can reside in either Java or Javascript, but not mixed in the markup.

au4liferz
au4liferzAuthor
New Participant
October 16, 2015

Would someone please help? What are the steps needed to try and do this component using Sightly??? Thanks in advance.

au4liferz
au4liferzAuthor
New Participant
October 16, 2015

So Feike, (or really, anyone who can provide an answer), are you saying that I would develop my function in JSP or JS, (e.g. a function to build <div>'s and <ul>'s and <li>'s based on the number of items I'm storing in the carousel), and then call them from Sightly??? I have gotten a JS plugin component working using static HTML, (i.e. the slick plugin), but I need to be able to get the properties from the AEM dialog, and dynamically create the HTML required for the number of items the author wants to display in the carousel. I can do this using JSP, mixed with some static HTML, but it's very ugly, (i.e. harder to read), and it's also tough because I have to instantiate different "slick" funtions based on the options that the author chooses from the AEM dialog, (e.g. when they want to display 4 slides instead of one, or when they want a responsive carousel etc.).

I'm also having a LOT of trouble implementing simple radio buttons, and having them register as true or false, based on whether the author selects the radio button. Also, once the radio is clicked, it doesn't seem that you can click it again, and deselect it. If any of you can help with these items and provide code samples, I would really, really appreciate it.

au4liferz
au4liferzAuthor
New Participant
October 16, 2015

Thanks to both of you for the responses. I hope the Sightly documentation on the Adobe site is enough for me to use the base component you linked to get this done. Hopefully, I can find most of the core functionality/logic in existing javascript libs.

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
New Participant
October 16, 2015

Refer [1] to create a sightly template and read values from the dialog 

[1] https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html

Refer [2] for multiple taglibs available in Sightly. It helps you to in #2 to loop through all the images and create div

[2] https://docs.adobe.com/docs/en/aem/6-0/develop/sightly.html

For #3, once you have read the values and created div, apply JS to get the carousel running.