sightly/HTL/AEM: using "tel:" on an href parameter (a tag) doesn't work

2.7k views Asked by At

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.

1

There are 1 answers

0
d33t On

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