Skip to main content
August 11, 2024
Question

Is it possible to have a property/variable for a carousel to set number of slides in the component instance?

  • August 11, 2024
  • 23 replies
  • 337 views

Hi guys,

Thanks as always to this fantastic community, had some invaluable advice before and it’s really appreciated!!

I’ve made a carousel, with pagination dots at the bottom and the biggest number of cards I need in it is 12.

However sometimes I will need less, and so I’m wondering if I can use boolean properties to choose the number of slides in the component instance?

It would also be great to be able to choose/link the pagination dots so that the corresponding value of slides needed, also removes excess pagination dots.

I’m just in the process of building out the gallery in my website prototype using my first instance use of the component, and I’m trying to have to avoid making the same component 12 times:

with 1 slide
with 2 slides
with 3 slides
etc

Any suggestions would be great here, as I’m having a block as to how best to approach it 🙂
Thank you

This topic has been closed for replies.

23 replies

newpurpleAuthor
August 14, 2024

Sorry for the delay guys - the last few days have been unexpectedly hectic.

Thank you once again Kenn 🙂 I really appreciate you trying!

I did think I must’ve made this using incorrect functions and methods so this makes sense as it was seemingly far more complex than it felt like it should be to achieve this.

newpurpleAuthor
August 14, 2024

I think this is the knowledge I’m missing as I realised half way through this that I just must be approaching incorrectly. Thank you for your suggestions and help and work Raphael.

Could you point me in the right direction in regards to rebuilding an infinite carousel correctly?

KennLucas
August 14, 2024

I found this tutorial to be pretty great.

I like his method and his tone in teaching. However I have had to watch a few parts over from time to time.

Although I still think the one @Raphael_M put together is smoother!