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.

$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 #555
    In the 555th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module that adds the ability to automatically convert email messages to pages, and more. Read on!
    Weekly.pw / 28 December 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“ProcessWire is like a breath of fresh air. So powerful yet simple to build with and customise, and web editors love it too.” —Margaret Chatwin, Web developer