Forum
Bootstrap carousel
I have a carousel template to reuse on the same page. How do I achieve that each of them has a unique id, like
<div id="carousel_1" class="carousel slide" data-ride="carousel">
...
</div>
<div id="carousel_2" class="carousel slide" data-ride="carousel">
...
</div>
Thank you for your much appreciated help!
Hi Martin, you can use:
<perch:content id="perch_item_index" type="hidden" />
eg:
Cool, that working! Thanx! One last question: any idea how to address only carousels? It's because there are other Perch items on that page, too. So the numbering is not 1, 2, 3.
Are you using a multi-item region, or perhaps a repeater for the carousel? In those instances I would expect it to be restricted to within the carousel in that case. Can you show your template?
It's a multi-item region with total 5 items. How can I make it restricted to the carousel? Have a look please:
Thank you, Simon!
You'll not be able to in that instance. Are you adding a block per slide state? I think you'll need to encapsulate the entire slider as one block and use a repeater for the slides.
Not sure how to encapsulate the slider. The slider is one of 5 items that can be put into the content of that page. The slider is one block (the second one) and I already use a repeater for the slides...
Ok, great. So is the count for the sliders (i.e. multiple sliders on the page) or for the slides within a slider?
It's for the sliders as I have multiple sliders on the page.
It's sliders all the way down!
I can't think of a good way to do that from the template. Do they need to be sequential?
It would have been nice, just because the order of the items could change. Thanks anyway, Drew!