Feature: Page contacts processor options and contacts event 

Description 

The data processor that hands the contacts of a page to a page template now provides what the contacts content element renders, and takes options:

  • A page template also receives contactsWithoutRole, the contacts without a role, which the content element lists below its role groups. A page template that renders the contacts grouped by role no longer loses them.
  • as puts contacts, roles and contactsWithoutRole below one variable of that name.
  • showHiddenRecords = 1 shows hidden contacts and the hidden e-mail addresses, phone numbers and addresses of a contact, as the Show hidden records option of the content element does.
  • pageUid reads the contacts of another page than the one that is rendered.

The processor has the identifier academic-page-contacts, which the shipped TypoScript uses at page.10.dataProcessing.400 . The class name keeps working, and so does a subclass of the processor that a project registers as described in Important: Contacts without a visible profile are skipped.

The new PSR-14 event \FGTCLB\AcademicContacts4pages\Event\ModifyPageContactsEvent lets a listener change the contacts of a page before the content element or the page template renders them. It tells the listener which of the two asked, and hands it the plugin context of the content element when the content element asked. The roles and the contacts without role are built from the list the listeners hand back.

See The contacts in a page template and ModifyPageContactsEvent.

Impact 

A page that keeps the shipped configuration renders as before, with the new variable contactsWithoutRole available to its template. A project that copied the controller of the content element, or subclassed the processor, to change which contacts it shows can replace the copy with a listener. The behaviour is the same on TYPO3 v13 and v14.