$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
This method does not modify the existing $pages object but returns a new object with the changes applied. Learn more →
Parent class
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']);