Template Methods


Introduced in Version 2.0


Get the value of a template's property (same as $template->$property)

Output the label of a given template.

$t = $templates->get("skyscraper");
echo $t->get('label'); //same as $t->label

Output the tag used to group the current page's template in the ProcessWire admin.

echo $page->template->get('tags'); //same as $page->template->tags

Find out if the specified template allows URL segments.

//same as $t->urlSegments (boolean)
if($t->get("urlSegments")) {
    echo "<p>This template allows URL Segments</p>";
} else {
    echo "<p>This template does not allow URL Segments</p>";


Post Comment