Skip to content

Kirby 3.8.4

pages()

Helper to build pages collection

pages(string|array $id = null): Kirby\Cms\Pages|null

Parameters

Name Type Default
$id string|array null

Return type

Kirby\Cms\Pages|null

Example

<?php $collection = pages(['home', 'blog']) ?>
<?php $collection = pages([$page, $page->children()->first()]) ?>

The pages() helper fetches published pages only; ids of draft pages are ignored.