Hey, so i´m currently working on a Website and I want to implement an imageslider but instead of images I want it to display module so you can add "news" or something like that. It should be infinite.
My current html Twig is:
<div class="swiper-container2">
<div class="swiper-wrapper2">
{% for module in page.collection() %}
<div class="swiper-slide2">
{{ module.content|raw }}
</div>
{% endfor %}
</div>
<div class="swiper-pagination2"></div>
<div class="swiper-button-next2"></div>
<div class="swiper-button-prev2"></div>
</div>
<script>
var swiper = new Swiper('.swiper-container2', {
loop: true,
pagination: {
el: '.swiper-pagination2',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next2',
prevEl: '.swiper-button-prev2',
},
});
</script>
The idea is, that i check for modules that fit and it should display every module in a seperate slide.
My problem is, it doesnt show me any Modules and when i try to debug it with:
{% else %}
<p>No Modules found</p>
it always says "No Modules found".
Anyone know how to fix this? or know what i am doing wrong?
Thanks for the help.