Feature #105318
Updated by Fabian Michael about 1 month ago
We have the requirement that we need to show only records for a specific language area like DACH but don't show records from the base language. With the overlay type mixed the fallbacks are working but it also shows all records from the base language. I tried all possible combinations when creating the language aspect and setting setRespectSysLanguage ture/false but nothing gave the desired result.
Say we have the following Records:
- Record 1: EN, DE
- Record 2: EN, DE, AT
- Record 3: EN
- Record 4: EN, AT
Taking the fallback chain into account (AT -> DE) it should result in:
EN: 1 (EN), 2 (EN), 3 (EN), 4 (EN)
DE: 1 (DE), 2 (DE)
AT: 1 (DE), 2 (AT), 4 (AT)
CH: 1 (DE), 2 (DE)
Currently overlay type mixed gives the following results:
EN: 1 (EN), 2 (EN), 3 (EN), 4 (EN)
DE: 1 (DE), 2 (DE), 3 (EN), 4 (EN)
AT: 1 (DE), 2 (AT), 3 (EN), 4 (AT)
CH: 1 (DE), 2 (DE), 3 (EN), 4 (EN)
Overlay type on only gives the requested language:
EN: 1 (EN), 2 (EN), 3 (EN), 4 (EN)
DE: 1 (DE), 2 (DE)
AT: 2 (AT), 4 (AT)
CH: nothing
What we currently need to do in order to achive the desired result is to fetch records in the fallback languge (say DE), take the l10n parent IDs and than fetch the records by IDs and overlay to the desired language. In TYPO3 11 we also had to implement a hook to take the fallback chain into account for the overlays.
Edit: In TYPO3 12 I had to migrate the hook into a listener for the BeforeRecordLanguageOverlayEvent