Issue in adding x-cq-linkchecker attribute to anchor tag | Adobe Higher Education
Skip to main content
Level 2
March 10, 2023
解決済み

Issue in adding x-cq-linkchecker attribute to anchor tag

  • March 10, 2023
  • 1 の返信
  • 636 ビュー

Hi all,

 

I have a requirement to add x-cq-linkchecker attribute to an anchor tag conditionally (basically on the basis of the option selected by author in dialog). I am aware that to add this attribute in /apps/cq/xssprotection/config.xml. Following is the xml entry in anchor tag:
<attribute name="x-cq-linkchecker">
<regexp-list>
<regexp name="anything"/>
</regexp-list>
</attribute>

The issue is that despite adding it to the config file in /apps/cq/xssprotection, I am still not able to use it in the anchor tag. Following is an example of how I have added it to the anchor tag:
<a
x-cq-linkchecker="${button.skipLinkChecker ? 'skip' : ''}"> Test anchor link </a>

This is what I see on page:
<a>Test anchor link</a>

Note: I have checked that ${button.skipLinkChecker} contains a value and that there is no issue in this condition.

 

Thanks

このトピックへの返信は締め切られました。
ベストアンサー AswiniLakshminarayanan

@99spanchal 

You can check the below points, if this issue is not resolved yet.

1. any other config file in project which is taking precedence of the /apps/cq/xssprotection/config.xml - verify in the HTML source of the page or in the Apache Sling XSS protection config - policy path value

2. If there is a SP upgrade done recently, do check if the latest config file is overlaid to /apps

3. try this <a ${button.skipLinkChecker ? 'x-cq-linkchecker' : ''}="anything">Test anchor link</a>
4. As mentioned in this thread, you should restart AEM instance for the new config to apply.

1 の返信

Adobe Employee
April 12, 2023

@99spanchal 

You can check the below points, if this issue is not resolved yet.

1. any other config file in project which is taking precedence of the /apps/cq/xssprotection/config.xml - verify in the HTML source of the page or in the Apache Sling XSS protection config - policy path value

2. If there is a SP upgrade done recently, do check if the latest config file is overlaid to /apps

3. try this <a ${button.skipLinkChecker ? 'x-cq-linkchecker' : ''}="anything">Test anchor link</a>
4. As mentioned in this thread, you should restart AEM instance for the new config to apply.