PageFieldInfo by Robin S

Adds information about options in Page Reference fields.

Page Field Info

A module for ProcessWire CMS/CMF. Adds information about options in Page Reference fields. Supports InputfieldSelect and inputfields that extend InputfieldSelect:

  • InputfieldSelect
  • InputfieldRadios
  • InputfieldSelectMultiple
  • InputfieldCheckboxes
  • InputfieldAsmSelect

Requires ProcessWire >= 3.0.61 and AdminThemeUikit.

Screenshots


Field config

Field config

Example of changes to inputfield

Inputfield

Example of info field filled out in Page Edit

Page Edit

Installation


Install the Page Field Info module.

Configuration


In the Input tab of the settings for a Page Reference field...

  • Tick the "Add info tooltips to options" checkbox to enable tooltips for the options in the field. Tooltips are not possible for Select or AsmSelect inputfield types so for those types you would want to tick the next option.
  • Tick the "Append info about selected options" checkbox to append information about the selected options to the bottom of the inputfield. If the Page Reference field is a "multiple pages" field then the info for each selected option will be prefixed with the option label (so the user will know what option each line of info relates to).
  • In the "Info field" dropdown select a text/textarea field that will contain information about the page, to be used in the tooltips and appended info. Of course this field should be in the template(s) of the selectable pages for the Page Reference field.

Hook

In most cases the "Info field" will supply the text for the tooltips and appended info, but for advanced usages you can hook PageFieldInfo::getPageInfo() to return the text. For example:

$wire->addHookAfter('PageFieldInfo::getPageInfo', function(HookEvent $event) {
    $page = $event->arguments(0); // The page
    $inputfield = $event->arguments(1); // InputfieldPage
    $field = $event->arguments(2); // The Page Reference field
    $info = $event->return; // Text from the info field, if any
    // Set some custom text as the $event->return...
});

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Latest news

  • ProcessWire Weekly #519
    In the 519th issue of ProcessWire Weekly we'll check out a new third party module called RockForms, introduce the latest ProcessWire core updates, and more. Read on!
    Weekly.pw / 20 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer