$pages->count()

Returns the number of pages in the collection

  • return (integer)

Example

Counting first level pages

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

Counting subpages

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

Counting all pages

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