Skip to content

Kirby 4.5.0

$pages->notTemplate()

Filter all pages by excluding the given template

$pages->notTemplate(string|array $templates): Kirby\Cms\Pages

Parameters

Name Type Default
$templates * string|array

Return type

Kirby\Cms\Pages

Parent class

Kirby\Cms\Pages

Examples

Using a string parameter to exclude a single template:

$articles = page('blog')->children()->listed()->notTemplate('video-article');

Using an array of options to exclude multiple templates:

$articles = page('blog')->children()->listed()->notTemplate(['video-article', 'short-article']);