$page->intendedTemplate()
Returns the template that should be loaded if it exists.
Return type
Parent class
Details
While $page->template()
returns the actually used template, $page->intendedTemplate()
returns the name of the content file, i.e.
Assuming you have a content file article.txt
, then $page->intendedTemplate()->name()
will return article
.
This method is therefore particularly useful to fetch or filter pages that don't have a corresponding template in the templates
folder.