Content Dimensions and TLDs (.de, .com, .at ...)

Hi Everyone!

I asked that on slack first, but than I thought disuss is a much better place for this question, since it probably is helpful for other users, confronted with the same problem as I am currently:
We have multi-domain site, that ideally should serve one content dimension with a .de-domain and the other with a .com-domain. Is it possible to substitute /de/ and /en/ (which is how I configured them currently) with the TLDs? Coming from the experience of configuring RealURL I’m so happy with how easy respectively “unattended” URL handling in Neos is, but I could not find any solution for this specific situation.
The problem is that we would really like to avoid changing the url-structure for the new project.

Our project is a “joomla-to-Neos” transformation and joomla seems to be able to do what we are trying to do with Neos.
Could also be that joomla is serving two different websites, but we don’t want to log in :wink:
But nevertheless, two sites would not really be an option here since a lot of new Document-Nodes need to be copied over to another dimension from time to time.

So is it possible, even with some jedi-neos-tricks?

Best regards,
Christian

Hi, currently it’s not possible the FrontendNodeRoutePartHandler must be refactored to allow more flexibility in this area.

Not sure how much time we need to make this possible, maybe @aertmann can give us a raw estimate. If you have some budget (time, code, or whatever contribution), that can help to make this real soon. I think you are not alone with this requirement.

1 Like

Hey Christian

Others have asked the same before, so there definitely seems to be a need for such a feature and personally also think it should be supported in the core. Can’t remember who did so in the past and how/if they solved it, hopefully they’ll chime in.

Can confirm it’s not possible out of the box, but can be achieved with some custom code.

The trick is to overwrite the FrontendNodeRoutePartHandler adding the logic you need.

This can be done since the routing is using an interface, see https://github.com/neos/neos/blob/master/Configuration/Routes.yaml#L63

To overwrite it create a custom class extending the default one and use Objects.yaml to overwrite the implementation class for the interface, example https://github.com/neos/neos/blob/master/Configuration/Objects.yaml#L45-L46

The context is build here https://github.com/neos/neos/blob/master/Classes/TYPO3/Neos/Routing/FrontendNodeRoutePartHandler.php#L240-L253

Everything related to the /de segment can be found by searching for uriSegment in the class.

The easiest solution is probably to remove the uriSegment setting from the dimension configuration completely and only rely on the domain for adding the language dimension.

Might be a bit tricky to achieve, but definitely doable.

For an estimate on how long it would take to get into the core, a rough estimate would be 2-3 days including the whole process of writing an RFC, getting feedback, implementing, documenting and the review process.

Also a related feature in development is RFC: Allow uriSegment to be empty for default presets

2 Likes

The problem with writing custom FrontendNodeRoutePartHandler.php is that it’s a big beast, and you would have to always look out for changes to that file in next versions of Neos. Wish it was composed out of smaller parts that could be swapped out/customized one by one, and maybe bigger things could be moved to some service, to make it a bit less fat.

2 Likes

+1 for making this a core feature!

1 Like