I am trying to get a component to link to an external location to work in rich text.
I found some articles with similar issues but none of them seem to have a working solution for our case.
We are using Tridion Sites 9 and DXA 2.2. When adding the component as a referece in rich text, it looks like this:
<p>This is a <a href="tcm:98-418208" title="Title">link</a> from the external link component</p>
When publishing, this will not resolve, which is understandable as the components isn't on one of our pages somewhere, it is meant to link to some external page.
We have thought about just putting the external link itself into the href, but this is undesirable because the idea of these external link components is that when a link changes there's only 1 place we have to change the link at, rather than everywhere we point to that link.
We have also thought of publishing this external link component on a page and then redirecting calls to that page to our external link.
This would mean changing the actual link in 2 places should it change, as well as the need for a hidden page for every single external link we wish to use in rich text.
The third option we have researched is adapting the data model, but we haven't figured out how we should change it to get this reference resolved without having to publish the link component to a page and if that is even possible at all.
So, summarizing: We want to link to an external location in rich text without putting the link directly into the rich text but are not sure what the best option to do so is.