InputfieldPage class

An Inputfield for handling relational Page inputs

Note that this Inputfield does not collect input on its own and instead requires its inputfield property to contain the class name of the Inputfield module that will be collecting input. It must be either InputfieldSelect or another Inputfield that extends it, such as InputfieldRadios, InputfieldCheckboxes, InputfieldAsmSelect, etc.


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the InputfieldPage class also inherits all the methods and properties of: Inputfield, WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
InputfieldPage::addClass($class)
InputfieldPage Inputfield

Add a CSS class name (extends Inputfield::addClass)

 
InputfieldPage::createFindPagesSelector()
string array

Create a page finding selector from all configured properties

 
InputfieldPage::getConfigInputfields()
InputfieldWrapper

Get field configuration Inputfields

InputfieldPage::getFieldSetups()
array

Get recommended setups for FieldtypePage/InputfieldPage

 
InputfieldPage::getInputfield()
Inputfield null

Get delegate Inputfield for page selection

 
InputfieldPage::getInputfieldOptions()
array

Get options available for page selection Inputfields

 
InputfieldPage::getPageLabel(Page $page)
string

Get a label for the given page

 
InputfieldPage::getSelectablePages(Page $page)
PageArray null

Return PageArray of selectable pages for this input

InputfieldPage::getSetting($key)
None 
InputfieldPage::getTemplateIDs()
array string

Return array or string of configured template IDs

 
InputfieldPage::has($key)
None 
InputfieldPage::isEmpty()
bool

Does this Inputfield have an empty value?

 
InputfieldPage::isValidPage(Page $page, $field)
bool

Is the given $page valid for the given $field?

 
InputfieldPage::processInput(WireInputData $input)
this Inputfield

Process input

InputfieldPage::render()
string

Render

InputfieldPage::renderReady()
bool

Called before render()

 
InputfieldPage::renderValue()
string

Render non-editable value

InputfieldPage::setAttribute($key, $value)
InputfieldPage Inputfield

Set an input attribute

 

For hooks

These methods are only useful for hooking and should not be called directly.

Properties

NameReturnSummary 
InputfieldPage::addable int bool Provide an option for creating new pages and adding them to selection? (deafult=false) 
InputfieldPage::allowUnpub int bool Allow selection of unpublished pages?
DEFAULT: false
 
InputfieldPage::derefAsPage int Make the value attribute a single Page rather than PageArray?
DEFAULT: 0
 
InputfieldPage::findPagesSelect string Same as findPageSelector, but configured interactively with InputfieldSelector.
DEFAULT: ''
 
InputfieldPage::findPagesSelector string Selector string to use for finding selectable pages
DEFAULT: ''
 
InputfieldPage::inputfield string Inputfield class used for input, i.e. InputfieldSelect
DEFAULT: ''
 
InputfieldPage::inputfieldClass string Read-only public property alias of protected getInputfieldClass() method. 
InputfieldPage::inputfieldClasses array Class names of Inputfields that are allowed to be used for selection
DEFAULT: 9+ classes
 
InputfieldPage::labelFieldFormat string Formatting string to use (which is sent to $page->getMarkup() method) as alternative to $labelFieldName.
DEFAULT: ''
 
InputfieldPage::labelFieldName string Field name to use for label, i.e. “title”. Note that this will be "." if $labelFieldFormat is in use.
DEFAULT: ''
 
InputfieldPage::parent_id int Parent ID of pages you want to be selectable
DEFAULT: 0
 
InputfieldPage::template_id int Single template ID used by pages you want to be selectable.
DEFAULT: 0
 
InputfieldPage::template_ids array Multiple template IDs used by pages you want to be selectable.
DEFAULT: []
 

Additional methods and properties

In addition to the methods and properties above, InputfieldPage also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252