PageField::setTemplate()

Set the single template to use for this page field

If using multiple templates, or if templates are specified in a selector, avoid using this method. To get current value use $field->template_id

Available since version 3.0.258.

Usage

$self = $pageField->setTemplate($template);

Arguments

NameType(s)Description
$templateTemplate int string

Template instance, name or id

Return value

self

Exceptions

Method can throw exceptions on error:

  • WireException - If template cannot be identified


PageField methods and properties

API reference based on ProcessWire core version 3.0.261