2

For DD4T for Java how do we resolve links in rich text format areas?

On my client's setup I notice some of these are not resolved. In other words, I see TCM Urls or ECL Ids on the rendered page.

  • Component Links
  • MediaManager Link (file distributions like a PDF)
  • Link to a Multimedia Component

I'm not sure which are "known issues" and which need classes to be extended or configuration. Any research leads for my devs are appreciated as well as where's the best place to resolve these (CM vs. CD).

Also, does the template output format matter (e.g. is REL required?)?

2 Answers 2

5

Link resolving in DD4T 2 Java can be resolved in a couple of ways:

In RTF

  1. Use the LinkResolverProcessor - this needs to be configured as Processor on the Component controller;

  2. Do it in the view model - you can also use the LinkResolver for it.

Binary Linking

Has some issues and needs rework in 2.0.1-beta. ETA for this is beginning September 2015.

ECL items

In principle, ECL uri's should never end up on the front end. You'll have to extend the DD4T BinaryPublisher to grab the ECL URLs, get a distribution URL from MM and put that in the to be published DD4T data (XML / Json)

Currently work is underway to have native ECL support in the DD4T templates and it's already in dd4t-2-templates 2.0.1-beta, as can be seen here: https://github.com/dd4t/dd4t-2-templates/blob/master/source/DD4T.Templates.Base/Utils/BinaryPublisher.cs

3

The RichTextWithLinksResolver (called a Filter in dd4t-1, a Processor in dd4t-2) does the work. Its essentially a wrapper class around an XSLT, that's executed in context of the dd4t factories.

Your Answer

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

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