Kiry Panel Page Numbers

Kiry Panel Page Numbers

If you are developing a field or a plugin for the panel pagination can be needed.


You need to be a developer to understand how this class works.

Example: example-field.php

include __DIR__ . DS . 'page-numbers.php';

class YourField extends BaseField {
	function input() {
		$this->PageNumbers = new PageNumbers();
		return $this->pageNumbers();

	function pageNumbers() {
		$children = $this->page->children()->sortBy('modified', 'desc');
		return $this->PageNumbers->get($this->page, $children, 'revisions-page', 1);


In this case the field input only return the pagination html, loaded from the pageNumbers method.


Here the magic happends. You need some arguments for it to work.


The method needs the page object to know the url to the pagination.


What pages do you want to list? Create a $children object of your choice.


This is the name of your $_GET key.


This is the limit of how many pages there can be on each page.


I really recommend to namespace the class.

Add something like this first in page-numbers.php:

namespace JensTornell\MyField;
use tpl;

And something like this first in example-field.php:

use JensTornell\MyField as MyField;

And when calling the class in example-field.php, do it like this:

$this->PageNumbers = new MyField\PageNumbers();



  • Init release


Kirby 2.3