$pages->count()

Returns the number of pages in the collection

  • return (integer)

Example

Counting first level pages

The site has
<?= {{class.instance}}->count() ?>
main pages

Counting subpages

This page has
<?= $page->children()->count() ?>
subpages

Counting all pages

The site has
<?= $site->index()->count() ?>
pages in total