$templates


Template Properties

$template->fields

Introduced in Version 2.0

Description

Syntactical alias for $template->fieldgroup. Use whatever makes more sense for your code readability.

Get and loop through this page's template's fields.

foreach ($page->template->fields as $f) {
    echo $f->name . "<br>";
}

Get and loop through a named page's template's fields.

foreach ($pages->get("/skyscrapers/")->template->fields as $f) {
    echo $f->name . "<br>";
}

Related

Post Comment