I've got a project with a multi-user / multi-domain environment. There is one "main" portal like
www.myproject.com and for every registered user with a specific custom permission
has_personal_subdomain there is a subdomain and a theme with his username, e.g. user
johndoe has a subdomain
johndoe.myproject.com and this domain is using his custom theme
I've already set up all the domains and the theme switching part. All editing/administrative actions are always done on the main portal domain, also users with personal subdomains work on the main portal domain.
The problem are the canonical entity links: When editing nodes, editing is always done in admin theme on the main portal domain, so of course all canonical entity links also point to the portal domain. E.g. for users with a personal subdomain, the canonical links to
www.myproject.com/my-node-url-alias, but I want
What is the best way to dynamically manipulate the canonical entity view links? I'm not asking for a complete code, I'm just looking for the best starting point/hook/event/service to inject my custom logic.
What I want to avoid:
Create a million custom hooks for
hook_views_pre_render AND whatever else...
I do not care about metatags, SEO, duplicate URLs,... I just want a better editor experience with personalized entity view links pointing to the correct subdomain using the correct theme.
I know there is the OutboundPathProcessor, but this seems a bit over the top, as I only want to change canonical URLs and none of the admin links.
Is there a service specifically for generating canonical URLs I can decorate?