Reference

Guide

$site->index()

Creates a flat child index

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

Parameters

Name Type Default Description
$drafts bool false

Return type

Kirby\Cms\Pages

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

// the index method is also perfect for a site-wide search
$results = $site->index()->search('mysearchword');

Source code

kirby/src/Cms/HasChildren.php#L221