Sightly removing "x-cq-linkcheker" attribute in anchor tag | Community
Skip to main content
Balu_M
Level 3
June 5, 2022
Solved

Sightly removing "x-cq-linkcheker" attribute in anchor tag

  • June 5, 2022
  • 1 reply
  • 824 views

Hi,

We are adding "x-cq-linkchecker" attribute to anchor tag using RTE link customization , Value stored in JCR but when we render using sightly code  "x-cq-linkchecker" is removed from anchor tag.

AEM Version: AEM Cloud as service (Local Jar file)

JCR data:

 

Rendered content:

 

HTL code:

 

Using Core components Text(V2)

 

 <p class="cmp-text__paragraph"
data-sly-unwrap="${textModel.isRichText}">${text @ context = textModel.isRichText ? 'html' : 'text'}</p>

 

 

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

Hi @balu_m ,

 

1. Override libs/cq/xssprotection/config.xml to include data attributes: This will allow context html to render them.

2. To avoid RTE editor to strip them, Disable xss filtering for both dialog and inplace editor by adding the property to the text node and the config node of the cq:inplaceEditing node using the disableXSSFiltering property of the RTE.

Reference: http://experience-aem.blogspot.com/2017/01/aem-62-touch-ui-extend-rich-text-link-dialog-add-rel-select.html

Hope that help you!

Regards,
Santosh

1 reply

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
June 5, 2022

Hi @balu_m ,

 

1. Override libs/cq/xssprotection/config.xml to include data attributes: This will allow context html to render them.

2. To avoid RTE editor to strip them, Disable xss filtering for both dialog and inplace editor by adding the property to the text node and the config node of the cq:inplaceEditing node using the disableXSSFiltering property of the RTE.

Reference: http://experience-aem.blogspot.com/2017/01/aem-62-touch-ui-extend-rich-text-link-dialog-add-rel-select.html

Hope that help you!

Regards,
Santosh

Santosh Sai