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 InputfieldAdd a CSS class name (extends Inputfield::addClass) 
InputfieldPage::createFindPagesSelector()
string arrayCreate a page finding selector from all configured properties 
InputfieldPage::getConfigInputfields()
InputfieldWrapperGet field configuration Inputfields
InputfieldPage::getFieldSetups()
arrayGet recommended setups for FieldtypePage/InputfieldPage 
InputfieldPage::getInputfield()
Inputfield nullGet delegate Inputfield for page selection 
InputfieldPage::getInputfieldOptions()
arrayGet options available for page selection Inputfields 
InputfieldPage::getPageLabel(Page $page)
stringGet a label for the given page 
InputfieldPage::getSelectablePages(Page $page)
PageArray nullReturn PageArray of selectable pages for this input
InputfieldPage::getSetting($key)
None 
InputfieldPage::getTemplateIDs()
array stringReturn array or string of configured template IDs 
InputfieldPage::has($key)
None 
InputfieldPage::isEmpty()
boolDoes this Inputfield have an empty value? 
InputfieldPage::isValidPage(Page $page, $field)
boolIs the given $page valid for the given $field? 
InputfieldPage::processInput(WireInputData $input)
this InputfieldProcess input
InputfieldPage::render()
stringRender
InputfieldPage::renderReady()
boolCalled before render() 
InputfieldPage::renderValue()
stringRender non-editable value
InputfieldPage::setAttribute($key, $value)
InputfieldPage InputfieldSet an input attribute 

For hooks

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

Properties

NameReturnSummaryDefault
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? false
InputfieldPage::derefAsPage int Make the value attribute a single Page rather than PageArray? 0
InputfieldPage::findPagesSelect string Same as findPageSelector, but configured interactively with InputfieldSelector. ''
InputfieldPage::findPagesSelector string Selector string to use for finding selectable pages ''
InputfieldPage::inputfield string Inputfield class used for input, i.e. `InputfieldSelect` ''
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 9+ classes
InputfieldPage::labelFieldFormat string Formatting string to use (which is sent to $page->getMarkup() method) as alternative to $labelFieldName. ''
InputfieldPage::labelFieldName string Field name to use for label, i.e. “title”. Note that this will be "." if $labelFieldFormat is in use. ''
InputfieldPage::parent_id int Parent ID of pages you want to be selectable 0
InputfieldPage::template_id int Single template ID used by pages you want to be selectable. 0
InputfieldPage::template_ids array Multiple template IDs used by pages you want to be selectable. []

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.251