PageFieldInfo by Robin S

Adds information about options in Page Reference fields.

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.


Field config

Inputfield

Page Edit


Install the Page Field Info module.


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.

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 #489
    In the 489th issue of ProcessWire Weekly we'll check out what's new in the core this week, share a brand-new recipe of the week, and more. Read on!
    Weekly.pw / 23 September 2023
  • ProcessWire 3.0.226 new main/master version
    After 8 months in development we are excited to bring you ProcessWire 3.0.226 main/master. This version has a ton of great new features, improvements and optimizations, plus more than 100 issue fixes. This post takes an in-depth look at highlights from this great new version.
    Blog / 25 August 2023
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH