Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

AEM 6.3 Custom RTE dialog truncates the additional parameters of anchor tag

Avatar

Level 2

Issue:

We have developed custom RTE link plugin where we could add additional parameters inside the anchor tag (like data-target, data-modal etc). On re-edit of the RTE the additional parameters are stripped/truncated.

Observations:

Step one: author the RTE dialog

Screen Shot 2018-12-01 at 3.12.07 AM.png

Step 2: Submit the RTE dialog. Content is properly stored in jcr content with additional parameters in the anchor tag

<p>A majority of Americans who are about to <a href="https://forums.adobe.com/content/test.html" data-target="#leavingModal" data-remote="false" data-toggle="modal">become</a> eligible for </p>

Step 3: Reopen the RTE Dialog, you wont see the additional parameters

Screen Shot 2018-12-01 at 3.18.51 AM.png

Question: Wondering why the RTE dialog is truncating/striping the additional parameters other than href and title. Can you please help me to identify where the truncating/striping is happening on RTE?

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi Sunil,

You need to add your custom parameter like data-target in xssprotection config file.

  1. Overlay /libs/cq/xssprotection/config.xml to /apps/cq/xssprotection/config.xml.
  2. Open /apps/cq/xssprotection/config.xml.
  3. In the common-attributes section, add the following attribute declaration.
  4. <attribute name="data-target ><regexp-list><regexp value="anything" /></regexp-list></attbribute>
  5. Find the a tag declaration by searching the term <tag name="a".
  6. Add the line below in the list of attributes:<attribute name="data-target" />

Add all your custom parameter and re-edit RTE dialog ,it should work fine.

Also make sure you have properly added login in dltToModel and dlgFromModel mtheods.

Hope this help.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 3

Hi Sunil,

You need to add your custom parameter like data-target in xssprotection config file.

  1. Overlay /libs/cq/xssprotection/config.xml to /apps/cq/xssprotection/config.xml.
  2. Open /apps/cq/xssprotection/config.xml.
  3. In the common-attributes section, add the following attribute declaration.
  4. <attribute name="data-target ><regexp-list><regexp value="anything" /></regexp-list></attbribute>
  5. Find the a tag declaration by searching the term <tag name="a".
  6. Add the line below in the list of attributes:<attribute name="data-target" />

Add all your custom parameter and re-edit RTE dialog ,it should work fine.

Also make sure you have properly added login in dltToModel and dlgFromModel mtheods.

Hope this help.