I’m using uikit and I’m making a slideshow. in my controller i didn’t limit the articles so all articles are showing in frontend.
Since I’m making a slideshow i want 3 articles to be showed in the active slide and the rest of the articles will be in the dot nav.
heres my code
<div class="slideshow uk-slidenav-position" data-uk-slideshow="{autoplay:true}">
<ul class="uk-slideshow">
<?php if($articles->count()): ?>
<?php foreach($articles as $article): ?>
<li>
<figure>
<div class="uk-block uk-block-primary">
<div class="blogImage">
<?php if($image = $article->coverimage()->toFile()): ?>
<img src="<?= $image->url() ?>"/>
<?php else : ?>
<em>No Image</em>
<?php endif ?>
</div>
<article class="blog-article uk-article">
<p class="uk-article-meta"><?php echo $article->date('F j, Y'); ?>
<br> by <?php echo $site->user($article->author())->firstName() ?> <?php echo $site->user($article->author())->lastName() ?></p>
<h2><?php echo $article->title()->html() ?></h2>
<?php echo $article->text()->excerpt(150) ?>
<div class="blog-readmore">
<a href="<?php echo $article->url() ?>" class="left-readmore hvr-icon-wobble-horizontal">Read More
<span class="uk-icon-angle-right"></span>
</a>
</div>
</article>
</div>
</figure>
</li>
<?php endforeach ?>
<?php else: ?>
<p>This blog does not contain any articles yet.</p>
<?php endif ?>
</ul>
<ul class="uk-dotnav uk-dotnav-contrast uk-position-bottom uk-flex-left">
<li data-uk-slideshow-item="0">
<a></a>
</li>
<li data-uk-slideshow-item="1">
<a></a>
</li>
<li data-uk-slideshow-item="2">
<a></a>
</li>
<li data-uk-slideshow-item="3">
<a></a>
</li>
</ul>
heres my controller
$articles = page('blog')->children()
->visible()
->flip()
->sortBy('date', 'desc', 'time', 'desc');