Link transformer config for Adobe campaign newsletter issue | Community
Skip to main content
deepankard86318
Level 2
November 1, 2017

Link transformer config for Adobe campaign newsletter issue

  • November 1, 2017
  • 5 replies
  • 10115 views

The href <a href="tel:1800813327" target="_blank"> is rewritten

to 

<a href=\"https://www.mysite.comnull\" target=\"_blank\">

Adobe Campaign makes the following call to AEM to fetch content -

https://authordomain/content/campaigns/edm.campaign.content.json

The '.campaign.content.json ' selector servlet forms the html content from com.adobe.cq.mcm.campaign.impl.ContentgeneratorImpl class which uses link transformer config at /libs/mcm/config/rewriter/campaign-link-rewrite to rewrite links( surprisingly, it uses domain name in the exernalizer configuration; and not from sling mapping; should it not be using domain name from sling mappings?) and appends domain name in front of the link

Hence, the href 'tel' is not working ; similarly; mailto will also not work

We have removed 'A' from includeTags in the rewrite config as a quick fix; but it excludes all anchor tag from the config. What is the appropriate method of making the tel attribute work? Can certain attributes excluded from the rewriter config ? Or can the rewriter transformer config be overridden ?

Can someone please help on this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

kautuk_sahni
Community Manager
Community Manager
November 1, 2017

Feike Visser  need your help here.

Kautuk Sahni
kautuk_sahni
Community Manager
Community Manager
November 1, 2017

Try:

To add 'tel:' as a "Special Link Prefix" in the configuration of the CQ Link Checker Service.

To do this, copy /libs/cq/linkchecker/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl to a config folder under apps (e.g. /apps/myapp/config). Then edit the property service.special_link_prefix to add tel: as a new prefix.

Or Have a look at similar thread:-

~kautuk

Kautuk Sahni
Feike_Visser1
Adobe Employee
Adobe Employee
November 1, 2017
deepankard86318
Level 2
November 2, 2017

H feike_visser,

I added x-cq-linkchecker=valid and x-cq-linkchecker=skip but it did not have any impact, the link it still being rewritten as

<a href=\"https://www.mysite.comnull\" target=\"_blank\">

Can it be because the link checker service is com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl while the rewrite transformer for the .campaign.content  selector is at com.adobe.cq.mcm.campaign.impl.LinkTransformer ?

I can't disable the entire link checker service as it will disable it for entire instance.

Also; have added 'tel:' as a "Special Link Prefix" in the configuration of the CQ Link Checker Service; but not sure if it is in play here.

Is there a configuration in link transformer config which can make it exclude specific hrefs? Like includeTags of html-parser which specfies which tags to include ?

manoj_devapath
Level 5
November 1, 2017

Can you try link checker configuration for your instance

Disable the CQ5 Link Checker

smacdonald2008
Level 10
November 1, 2017

As other members have pointed out - try to disable link checker.

deepankard86318
Level 2
November 2, 2017

hi smacdonald2008​,

It is not working

kautuk_sahni
Community Manager
Community Manager
November 2, 2017

Not Tested but worth trying:- https://jeroendruwe.be/aem-allow-specials-link-prefixes/

//

Add the following xml file to a config folder under apps (e.g. /apps/myapp/config). in your project. com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl.xml

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" jcr:primaryType="sling:OsgiConfig" service.special_link_prefix="[javascript:,data:,mailto:,#,${,tel:]"/>

By now you should be able to see your new allowed list of prefixes under http://localhost:4502/system/console/configMgr > Day CQ Link Checker Service

Make it 'unsafe'

We need to disables escaping of are telephone number by doing the following:

href="${linkCtrl.link @ context='unsafe'}

More reference link:- Configuring Telephone Tags within Rich Text components and the Link Checker | 6D Labs

~kautuk

Kautuk Sahni
deepankard86318
Level 2
November 2, 2017

Hi kautuksahni

As mentioned in previous comment I have already tried it but did not work.

smacdonald2008
Level 10
November 2, 2017

If you tried all the documented ways - and its not working - could be a bug. Consider opening a support ticket.

Level 2
February 22, 2018

Any further pointers on this?

How can we make "mailto:" work fine once its transformed from AEM to Campaign?

deepankard86318
Level 2
February 22, 2018

Adobe acknowledged it as product bug and will be releasing the fix in AEM 6.3 SP2

Level 2
February 22, 2018

Thanks Deepankar. Could you please forward me the article/post that says so?