Skip to content

Kirby 5.0.4

$pages->notTemplate()

Filter all pages by excluding the given template

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

Parameters

Name Type Default
$templates arrayorstringornull no default value

Return types

Kirby\Cms\Pages

This method does not modify the existing $pages object but returns a new object with the changes applied. Learn more →

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']);