Hi Teodor,
I haven’t used a swiper with dynamic content - so I could be doing something wrong - but it seemed straightforward and works fine, apart from the height. This is the code:
<div is="dmx-swiper" id="swiper1" grab-cursor="true" loop="true" dmx-bind:slides="sc_recentitems.data.qry_recent_items" space-between="8" navigation="true" autoplay="true" speed="900" slides-per-view="2" slides-per-view-md="2" slides-per-view-lg="4" slides-per-view-xl="5" mousewheel="true" loop-fill="true">
<div class="swiper-slide">
<div class="card">
<img class="card-img-top" alt="Card image cap" dmx-bind:src="'jpegs/' + stock_id + '.jpg'">
<div class="card-body d-flex flex-column">
<h4 class="card-title">Card title</h4>
<p class="card-text">{{title}}</p>
<a href="#" class="btn mx-auto btn-primary">more details</a>
</div>
</div>
</div>
</div>
I fiddled around with it quite a bit, but I think I’ve removed my experimental CSS. I made a slight change to centre the button at the bottom of the card - I think that’s all.
I don’t see how I can wrap the cards in <div class="card-group">
- which would be one way of getting the desired result. Obviously if I put this above <div class="card">
, it’s going to wrap each card div, not the group of cards. If I put it outside the repeat, then the swiper divs/classes will get in the way.