Feature: Dedicated selection of address records 

Description 

A contact record ( tx_academiccontacts4pages_domain_model_contact ) now carries three additional selects, grouped in the palette Displayed address records:

  • E-mail address ( email_address )
  • Phone number ( phone_number )
  • Physical address ( physical_address )

They are offered as soon as a contract is selected and list the email addresses, phone numbers and physical addresses of exactly that contract. The contract field reloads the form on change, so the selects always match the contract that is currently selected.

Each select offers two options besides the address records themselves:

Display all
The default. All address records of that kind are rendered, the behaviour of every contact record created so far.
Do not display
The address record kind is left out of the frontend output for this contact entirely.

The narrowing is applied by the contact record itself, so it takes effect in the Contacts for this page plugin, in the page based rendering through ContactsProcessor and in project templates built on either of them - they all reach the address records through Contact::getContract() . Contact::getUnfilteredContract() returns the contract with all of its address records.

Only default language records are offered: the selection is shared by all translations of a contact, and the frontend resolves the language overlay of the address records itself. Deleted records are not offered. Hidden ones are, marked with a [Hidden] prefix - whether they reach the frontend is decided by the plugin, see below.

Impact 

Editors can restrict a page contact to a single email address, phone number and physical address of the contract, or suppress a kind completely - for example to publish the office phone number of a person on one page and the private one on another, from the same contract.

Hidden address records reach the frontend only through the Contacts for this page plugin and only while its Show hidden records option ( settings.showHiddenRecords ) is enabled, the same option that decides about hidden contacts. That covers both ways of displaying them: with the option enabled a hidden record is part of Display all and can be selected as the single one to display. Everywhere else - the page based rendering through ContactsProcessor included - hidden records are left out, and a selection pointing at one behaves like Do not display.

A selection that cannot be resolved at all behaves the same way and renders nothing. This happens when the contract of a contact is switched after the selection was made, or when the selected address record is deleted afterwards. There is deliberately no fallback to Display all: publishing the private phone number of a person because a record was removed is worse than publishing nothing.

Affected Installations 

All installations using the EXT:academic_contacts4pages extension starting with version 2.4. The three new columns default to Display all, so existing contact records keep their current frontend output and no migration is required. A database compare has to be applied for the new columns.