Feature: Choose which contracts a profile shows
Description
Every view rendered every contract of a profile. Editors and integrators now choose which of them:
- The list and list-and-detail elements offer Contracts per profile - all of them or only the first -, Only contracts of the selected organisational units and function types and Only contracts valid today.
- The card and selected-profiles elements offer Contracts per profile and Only contracts valid today. They select their profiles by hand and apply no unit or function type restriction.
- The detail view is configured in
Settings., per block:yaml profile.anddetails. position profile.takedetails. contact contracts(allorfirst) andonly.Valid
The options apply in a fixed order: the unit and function type filter, then validity, then "first". "First" is therefore the first of the contracts left, in the editor's order of the profile's contracts. A contract without a start or end date is not limited on that side.
While a list or list-and-detail element is restricted to organisational units or function types, or a visitor filters it, "only contracts valid today" also decides which contracts select a profile: a profile is listed through a contract only when that contract is valid today. A list without such conditions keeps listing a profile whose contracts have all ended, without a contract.
While "only valid today" applies, a page is cached no longer than until the next
midnight on which a contract that passes the unit and function type filter
starts or stops being valid, so the change is visible on that day rather than
with the next regular cache expiry - at most 24 hours away on TYPO3 v13, and a
year on TYPO3 v14 without
config.. The shorter
lifetime is set on the page cache of the request that rendered the contracts.
For a list that selects its profiles through valid contracts, the contracts of
profiles it does not list yet count as well. Without the option, the page keeps
the lifetime it would have without it.
The selected-contracts element and the contacts element of EXT:academic_contacts4pages render the contract that was chosen, whatever the options say.
Templates select the contracts through the new ViewHelper
<persons: of the namespace
http://. See
Which contracts a profile shows and Which contracts an item renders.
Impact
Nothing changes until an option is set: the defaults show every contract, as
before, and the shipped Settings. states them for both detail
blocks.
A project copy of Partials/,
Partials/ or
Partials/ that loops over
{profile. ignores the options. Replace the loop with the
ViewHelper, as the shipped partials do, and a template filter of its own can go.