About Custom Inputfield Dependencies
Extends inputfield dependencies so that inputfield visibility or required status may be determined at runtime by selector or custom PHP code.
Admin helper modules are those that provide helpful tools, UI enhancements or optimizations to the admin panel (excluding Fieldtype or Inputfield modules).
Close to stable, but users are advised to be cautious and test thoroughly.*
|Date Added||January 10, 2017|
|Last Updated||July 14, 2020|
This module's files should be placed in /site/modules/CustomInputfieldDependencies/
How to install or uninstall modules
A module for ProcessWire CMS/CMF. Extends inputfield dependencies so that inputfield visibility or required status may be determined at runtime by selector or custom PHP code.
Custom Inputfield Dependencies adds several new settings options to the "Input" tab of "Edit Field". These are described below.
Note that the visibility or required status of fields determined by the module is calculated once at the time Page Edit loads. If your dependency settings refer to fields in the page being edited then changes will not be recalculated until the page is saved and Page Edit reloaded.
Install the Custom Inputfield Dependencies module.
The custom inputfield dependencies are set on the "Input" tab of "Edit Field".
Use InputfieldSelector to create a $pages->find() query. If the edited page is matched by the selector then the field is shown.
As above, but the selector string may be entered manually.
Enter custom PHP/API code – if the statement returns boolean true then the field is shown.
$pages are available as local variables – other API variables may be accessed with
In most cases
$page refers to the page being edited, but note that if the field is inside a repeater then
$page will be the repeater page. As there could conceivably be cases where you want to use the repeater page in your custom PHP the module does not forcibly set
$page to be the edited page. Instead, a helper function
getEditedPage($page) is available if you want to get the edited page regardless of if the field in inside a repeater or not.
$edited_page = $this->getEditedPage($page);
The settings inputfields are the same as for Visibility above, but are used to determine if the field has 'required' status on the page being edited.
Released under Mozilla Public License v2. See file LICENSE for details.
- Admin Helpers
- Core Modules
- Development Tools
- Field Types
- Input Fields
- Language Modules
- Language Packs
- Markup Generation
- Premium Modules
- Process Modules
- Proof of Concept
- Site Profiles
- Social, Feeds, Services
- Text Formatters
- Other Modules
- Users and Access
*Use modules at your own risk. There are no guarantees or warranties. It is recommended that you backup your site and database before installing new modules.