Score:1

How to add link to translated content in text field

cn flag

I need some help on a multilingual D9 site, trying to add links to translated node in text field. In German version should be a link to the English and French version of this node, as part of the node content.
And I need them absolute, because the nodes are used as newsletter content: https://example.de/en/node/123
I created link with language part in url, but when I view the node, the links are rendered without translation. The en/ and fr/ part in the url are stripped.
I'm using CKEditor for content creation.
Any help appreciated, thanks.

cn flag
There's a language switcher block available on the blocks page that will automatically generate links to the same page in the other enabled languages. Does that do what you need?
cn flag
I know about the language switcher block, but I need the links inside a text field with user generated content.
cn flag
The problem seems to be CKEditor. If I use a text format without CKEditor, the links are not altered. So my solution could be to create an extra text field for the translation links and render it above or underneath my content field.
Score:0
cn flag

I solved this problem by using an extra field without CKEditor to add translation links. The links are working and no language part is stripped from URL.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.