- Issue created by @Paul Dudink
- First commit to issue fork.
It would be really useful to be able to link to a specific node and instead get the URL of an asymmetrically translated node back instead.
Currently when we for example link to a node in Twig (e.g. {{ path('entity.node.canonical', {'node': node.id}) }}
), Drupal simply doesn't know about the AST. Now this is part of the philosophy, because we don't want this module to interfere too much with core functionality.
However, we should provide a way for the developer to ask for a link in the correct language instead.
Provide a route that checks for asymmetric translations and if available, returns a URL in the current language.
Suggestion:
{{ path('entity.asymmetric_node_translation.canonical', {'node': node.id}) }}
Note: We've had an internal discussion on whether this should be entity.ant.canonical
or entity.asymmetric_node_translation.canonical
. Since in all known cases this seems to the full words, we'll go for that. That will also prevent any collisions with other modules in the future.
In the above suggestion, the new route should:
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.