RTE Plugin
Can you give the solution to customize and create the RTE plugin for external link builder experience in RTE for AEM to add the anchor tag and have data-link-attrs for modal popup inside the a tag
Can you give the solution to customize and create the RTE plugin for external link builder experience in RTE for AEM to add the anchor tag and have data-link-attrs for modal popup inside the a tag
Hey
data-link-attrsvalue. On apply, it inserts
<a href="..." data-link-attrs="modal">text</a>into the RTE content, enabling front-end modal popup behavior.
3 files under
ui.apps/.../apps/wknd/clientlibs/clientlib-rte-plugins/:
1.
.content.xml— Registers clientlib with
cq.authoring.dialogcategory
2.
js/ExternalLinkPlugin.js— Registers plugin
externallinkwith feature
externalLinkModal:
Adds toolbar button with link icon
Opens Coral dialog with fields: Link Text, URL, data-link-attrs
Inserts
<a href="..." data-link-attrs="modal"> via inserthtml command3. RTE Config — Enable in policy/dialog:
Add
<externallink features="externalLinkModal"/> under rtePlugins Add
#externallink-externalLinkModal to toolbar arraysOutput HTML:
<a href="https://example.com" data-link-attrs="modal">Click here</a>
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.