3

I am looking for a solution for component links in rich text not being resolved. 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. We have this issue that component links in rich text fields are not getting resolved. Our editors entered a link in a rich text field which looks like this under the "Source" tab in Tridion:

<p>This is a <a href="tcm:98-418208" title="Title">link</a> from the external link component</p>

When debugging the C# code of the getter of this rich text field in the model, we see that the tcm number is not resolved. Even the href and title have been removed at all, resulting in this plain text value:

<p>This is a link from the external link component</p>

I read an article mentioning the "dxa.defaults.rich-text-resolve" setting in the dxa.properties file of the DXA Model Service/Extension which I suspected to be set to false, since the link is not been resolved. I know the DXA Model Service/Extension is installed on our system but I could not find the dxa.properties file, so I could not check and change this setting.

I also read an article in which was mentioned that you should use **xlink:**href=... but that did not solve it either.

Any suggestions for how to solve this?

8
  • 1
    If all is well, Component links in Rich Text Fields get stored as XLinks; you can check that in the Source tab in the CME (and/or by checking the rendered DXA R2 JSON). Indeed, the DXA Model Service/Extension should resolve such XLinks for you. AFAIK, it does that by default. Feb 16 at 17:04
  • 1
    Is the link resolvable at all? Is the linked component added directly to a Page with a CT with a priority different than 'Never Link'?
    – Atila Sos
    Feb 16 at 18:47
  • @Rick Pannekoek: indeed, in the source tab, I can see that the component links are stored as xlinks. However, they get not resolved. Feb 17 at 9:46
  • @Atila Sos: the linked component is added to a rich text field, using the Hyperlink option from the Format ribbon and then select "Component" in the Type field and then browse to the component containing the link. Feb 17 at 9:46
  • 1
    @Raymond: the component link which you added in a RTF, is it already added to a published page? Feb 17 at 10:02
2

The fact that the hyperlink is removed altogether indicates that the DXA Model Service/Extension did process/resolve the link, but link resolution didn’t provide results (i.e. the linked Component is not found on any published Page). In that case, the hyperlink is suppressed.

So, all seems fine except that the link doesn’t resolve whereas you do expect it too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.