$templates


Template Properties

$template->fieldgroup

Introduced in Version 2.0

Description

Get or set a template's Fieldgroup. Can also be used to iterate a template's fields.

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

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

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

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

Related

Post Comment