hi! I want to use pagination… but when I click next, prev button, it just go to same url… not with page number. can anybody help me…?
<?php snippet('works/header') ?>
<?php
$tag = param('tags');
$works = page('works');
$items = null;
if ($works) {
$items = $works->children()->listed();
}
if ($tag) {
$items = $items->filterBy('category', $tag, ',');
}
?>
<section class="container">
<?php if ($works): ?>
<?php if ($items && $items->isNotEmpty()): ?>
<section class="list-view" id="list-view">
<?php foreach ($items as $item): ?>
<a href="<?= $item->url() ?>">
<div class="list-des">
<div class="list-view-title"><?= $item->title() ?></div>
<div class="list-view-category"><?= implode(' / ', $item->category()->split(',')) ?></div>
</div>
</a>
<?php endforeach ?>
</section>
<section class="works-images" id="works-images">
<?php foreach ($items->paginate(5) as $item): ?>
<a href="<?= $item->url() ?>">
<div class="works-image-thumb">
<?php
$coverImage = $item->cover()->toFile();
$resizedImage = $coverImage->resize(2000);
?>
<img src="<?= $resizedImage->url() ?>" alt="<?= $item->title() ?>">
<div class="work-des">
<h2><?= $item->title() ?></h2>
<p><?= implode(' / ', $item->category()->split(',')) ?></p>
</div>
</div>
</a>
<?php endforeach ?>
</section>
<section class="m-works-images" id="m-works-images">
<?php foreach ($items as $item): ?>
<a href="<?= $item->url() ?>">
<div class="works-image-thumb">
<img src="<?= $item->mobileCover()->toFile()->url() ?>" alt="<?= $item->title() ?>">
<div class="work-des">
<h2><?= $item->title() ?></h2>
<p><?= implode(' / ', $item->category()->split(',')) ?></p>
</div>
</div>
</a>
<?php endforeach ?>
</section>
<a href="<?= $item->pagination()->nextPageURL() ?>">prev</a>
<a href="<?= $item->pagination()->prevPageURL() ?>">next</a>
</section>
<?php endif ?>
<?php endif ?>
</section>
<?php snippet('works/footer') ?>