$pages


Built-in Methods Reference

$pages->count("selector")

Introduced in Version 2.0

Description

Count pages matching the selector. Returned count is filtered unless an include mode is specified.

This method has little overhead as it doesn't load the pages like $pages->find() does. Returned count excludes hidden, unpublished and no-access pages, unless an "include=x" mode was specified, where "x" is "hidden", "unpublished" or "all". 

Examples

Find all Skyscrapers matching a criteria and return how many were found.

$count = $pages->count("template=skyscraper, height>500");


Related

Post Comment