Skip to content

Kirby 3.5.7.1

pages()

Helper to build page collections

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

Parameters

Name Type Default
$id string|array null

Return type

Kirby\Cms\Pages

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.