I am not sure how a core implementation could look like it would have to be very flexible to support all possible use-cases. What i already did on some occasions already was adding some http-components that are manipulating the incoming url-path.
The following steps were required for my solution:
manipulate incoming urls to add the dimension path segments if they are missing
Manipulate the generated urls to take out the url-segments you want to hide. I aspected the LinkingService for that.
Make sure to do the above only in live context to avoid trouble in the backend.
The problem i see here is that while this is a very common problem the solution is not generic and will often require further adjustments. That is why i would prefer extracting the contextEncoding. That would make it possible to create the above as separate package.
The core would come with a simple basic solution like now that can be replaced with more sophisticated ones.
I think this is a very good idea!
I would contribute as much as I can to the separate TLD <-> ContentDimension package, so I have to find someone who would do the “context encoding” stuff in the core and can say how much the client has to invest for the core function.
I really like this idea and was already searching for sth. like this on some earlier projects.
Please contact me if you start any package to achieve the mapping as i would like to contribute as much as possible to get this done