Configuring Telephone Tags within Rich Text components and the Link Checker

Configuring Telephone Tags within Rich Text components and the Link Checker

If you define a rich text field (xtype=richtext) in your componets dialog, if you try to enter a telephone link like

<a href="tel:+13174562564">317-456-2564</a>

when you try to save the content, the telephone link will be stripped out and not saved.

You need to add the htmlRules and links node to your rich text field node

 <htmlRules jcr:primaryType="nt:unstructured">                        
    <links jcr:primaryType="nt:unstructured"                            
        protocols="[http://,https://,ftp://,tel:,mailto:,file://]"
    />                    
</htmlRules>

The tel: tag is defined in the protocols properties.
Which should look like this, when it is included

<itemsjcr:primaryType="cq:WidgetCollection">
    <text
           
jcr:primaryType="cq:Widget"
           
editElementQuery="div[class=&quot;text&quot;]"
            
hideLabel="{Boolean}true
           
name="./text"
            
xtype="richtext">
            
<htmlRulesjcr:primaryType="nt:unstructured">
                     <links
                          
jcr:primaryType="nt:unstructured"
                          
protocols="[http://,https://,ftp://,tel:,mailto:,file://]"/>
              </htmlRules>

When you preview the page, you will notice the CQ5 Link Checker Service will say that it is an invalid link.
So you will now have to configure the link checker to accept it.

The simplest way to do it, is to go to the OSGI console at   http://localhost:4502/system/console/configMgr
Click on the Configuration Tab
Edit the "Day CQ Link Checker Service"
In the Special Link Prefixes section add the following
tel:
Then click on Save.

This is saved in the repository in following node /apps/cq/linkchecker/config
so you can use filevault to save /apps/cq/linkchecker/config to SCM or the package builder to package this configuration, to deploy to other CQ environments.

 

 

 

 

Share this post

0 Comments

comments powered by Disqus