Get ALL pages in kirby

Hey,

i want to get all pages with a single foreach. Is that possible?
$site->pages() only gives me the children…

Best
Marvin

Hey,

try this

$allpages = $kirby->site()->index();

Note that using $site->index() is not really recommended for huge sites:

1 Like