2

In our DXA application, we have a component, wherein the RTF field we are creating a hyperlink to a DCP, which is published independently.

Now when we try to retrieve the component's content, the model service output removes the link information completely, and hence the DCP link is not available to the DXA Web Application.

When we check the broker, the link information is present.

"Content": {
        "introduction": "asdasfasg",
        "bodyText": {
          "$type": "ContentModelData",
          "bodyText": {
            "$type": "RichTextData",
            "Fragments": [
              "Hejsan <a title=\"Table test\" class=\"pop-up-window\" href=\"tcm:37-154562\">hej</a><!--CompLink tcm:37-154562-->"
            ]
          }
        }
      },

However, the JSON response from the model service is not sending the link information.

 "Content": {
        "bodyText": {
          "$type": "ContentModelData",
          "bodyText": {
            "$type": "RichTextData",
            "Fragments": [
              "Hejsan hej"
            ]
          }
        },

We tried by setting the dxa.properties value -> "dxa.defaults.rich-text-xmlns-remove=false", but still no luck.

Please kindly suggest where else to verify to resolve this issue? TIA

1 Answer 1

3

The Model Service will remove all component links which cannot be resolved to a proper html link.

The only work around I'm aware of of is to disable RTF component link resolving completely. This can be done by changing the dxa.properties value -> "dxa.defaults.rich-text-resolve=false".

That way all Component links will be sent across unresolved. Now the web application can implement its own link resolving, which can include custom logic for handling unresolved component links.

2
  • Thanks Jacques. However, for the custom logic for handling unresolved component links from the web application, do we have any standard solution available for the same for DXA?
    – NewUser
    Feb 2, 2019 at 3:03
  • I'm not aware of a standard solution. I would take the 1.x richtext link resolver as an guideline. And base my solution on that. Feb 2, 2019 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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