Template::parentTemplates() method

Get or set parent templates (templates allowed for parent pages of pages using this template)

  • May be specified as template IDs or names in an array, or Template objects in a TemplatesArray.
  • To allow any template as parent, specify a blank array.
  • To disallow any parents (other than what’s already in use) set the $template->noParents property to 1.

Available since version 3.0.153.

Usage

// basic usage
$items = $template->parentTemplates();

// usage with all arguments
$items = $template->parentTemplates($setValue = null);

Arguments

NameType(s)Description
setValue (optional)array, TemplatesArray, null

Specify only when setting, an iterable value containing Template objects, IDs or names

Return value


Template methods and properties

API reference based on ProcessWire core version 3.0.172

Twitter updates

  • This week ProcessWire gained powerful new tools for finding pages and controlling how they are loaded. If you like to maximize performance and efficiency, you’ll like what 3.0.172 brings— More
    5 February 2021
  • ProcessWire 3.0.171 dev branch core updates – More
    22 January 2021
  • Preliminary 2021 roadmap in progress in this week’s update— More
    8 January 2021

Latest news

  • ProcessWire Weekly #354
    In the 354th issue of ProcessWire Weekly we're going to check out the latest core updates, properly introduce the ProcessCKInlineComplete module, and dig into a brand new site of the week. Read on!
    Weekly.pw / 20 February 2021
  • ProcessWire 3.0.172 – Find faster and more efficiently
    This week ProcessWire gained powerful new tools for finding pages and controlling how they are loaded. If you like to maximize performance and efficiency, you’ll like what 3.0.172 brings.
    Blog / 5 February 2021
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH