Skip to content

Kirby 5.0.4

$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

This method modifies the existing $page object it is applied to and returns it again.

Parent class

Kirby\Cms\Page

Examples

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