Skip to content

texnixe/k3-pagemethods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

k3-pagemethods

A collection of page methods for Kirby 3.

Usage example for getPrev()/getNext()

<?php $collection = $page->siblings()->filterBy('template', 'article') ?>

<?php if ($collection->isNotEmpty()) : ?>
  <?php if ($prevPage = $page->getPrev($collection)) : ?>
      <a href="<?= $prevPage->url() ?>"><?= $prevPage->title()->html() ?></a>
  <?php endif ?>

  <?php if ($nextPage = $page->getNext($collection)) : ?>
      <a href="<?= $nextPage->url() ?>"><?= $nextPage->title()->html() ?></a>
  <?php endif ?>
<?php endif ?>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages