Reference

Guide

$page->index()

Creates a flat child index

$page->index(bool $drafts = false): Kirby\Cms\Pages

Parameters

Name Type Default Description
$drafts bool false

Return type

Kirby\Cms\Pages

Example

// goes through any subpage, subsubpage, etc. below $page and returns them by template
$articles = $page->index()->filterBy('template', 'article');

// the index method is also perfect for searching
$results = $page->index()->search('mysearchword');

Source code

kirby/src/Cms/HasChildren.php#L221