I’m strugling with content dimensions that aren’t completely distinct.
The obvious example for different content dimensions is language and country.
The obvious example for fallback of content dimensions is language.
Both examples are not only obvious but actually part of the official documentation:
But as soon as languages with fallback on one side should go together with countries on the other side, those aren’t really distinct dimensions any longer.
Here’s a quick example.
- Germany should use german only.
- France should use french only.
- Switzerland should use both, german and frech.
- If no german node for Switzerland is available, the german node for Germany should be used.
- If no french node for Switzerland is available, the french node for France should be used.
That’s actually not a language fallback but a country fallback. But the country to fall back to depends on the selected language.
This kind of configuration is not possible currently. And to be honest, I fear allowing such things renders the dimension configuration way too complex.
So you might end up with something like this, which works with the current feature set:
contentDimensions: 'locale': default: 'de-DE' defaultPreset: 'de-DE' label: 'Language' icon: 'icon-language' presets: 'de-DE': label: 'German (Germany)' values: ['de-DE'] uriSegment: 'de-DE' 'fr-FR': label: 'French (France)' values: ['fr-FR'] uriSegment: 'fr-FR' 'de-CH': label: 'German (Switzerland)' values: ['de-CH', 'de-DE'] uriSegment: 'de-CH' 'fr-CH': label: 'French (Switzerland)' values: ['fr-CH', 'fr-FR'] uriSegment: 'fr-CH'
Here the country and language information got lost completely in favor of proper fallback configuration.
But now the drawback is being not able to create language menus or country menus based on dimensions any longer. Plus: A single select field for locales in the Neos backend gets ugly in huge projects.
So although that’s a working solution, it’s kind of an unsatisfying one.
I must confess, I cannot give a nice solution for that. There is an idea, but it requires a lot of configuration for just that simple example.
I thought about “derived dimensions”. On top of the “locale” dimension above, a new dimension “country” (being derived from locale) can be skipped from URI parts and shell not be used for resolving but could be used to ease up backend handling and to create a language menu.
Any comments about this?