Skip to content

Kirby 3.6.6

$page->index()

Creates a flat child index

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

Parameters

Name Type Default Description
$drafts bool false If set to true, draft children are included

Return type

Kirby\Cms\Pages

Parent class

Kirby\Cms\Page

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');