2

help please. I have this very simple code.

<sly data-sly-test.temp1="tel:+61-8-8201-3343"></sly>
<a href="}${temp1}">my link</a>

it works fine if using "mailto" as target but when using "tel", the href tag is empty (inspected the tag using firebug while on view as published).

Also as can be seen in the sample code, my last line displays the value. The value displays fine when using "mailto" and "tel".

If I change my code to

<a href="tel:123-456-789">
    ${properties.linkTitle}
</a>

The href tag is populated properly.

any ideas what I am doing wrong? Thanks

edit:

based on suggestions from this link, I modified both:

  1. /libs/cq/xssprotection/config.xml
  2. /libs/sling/xss/config.xml

and restarted my local AEM instance but nothing would work.

Community
  • 1
  • 1
mrjayviper
  • 2,258
  • 11
  • 46
  • 82
  • 5
    Possible duplicate of [Rendering telephone links in HTL based on input from a Rich Text widget](http://stackoverflow.com/questions/39535342/rendering-telephone-links-in-htl-based-on-input-from-a-rich-text-widget) – Vlad May 16 '17 at 06:30
  • 1
    As pointed out by @Vlad in the duplicate post, you need to check your XSS configs for this to work. – Imran Saeed May 16 '17 at 10:42
  • @Vlad thanks for the tip. edited my original post with new findings. – mrjayviper May 17 '17 at 06:18
  • Try using [display context](https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/master/SPECIFICATION.md#121-display-context) of HTL. – Mohit Bansal May 17 '17 at 06:26

1 Answers1

3

The link checker transformer is removing your tel: link, because the prefix is not known in it's configuration. All links are checked and the invalid are removed when the template is rendered.

You have to extend the CQ Link Checker Service configuration by adding "tel:" as new "Special Link Prefix".

In order to to this just copy the configuration from /libs/cq/linkchecker/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerImpl to your config folder e.g. /apps/myapp/config and edit the property service.special_link_prefix

d33t
  • 1,143
  • 6
  • 15