Expand my Community achievements bar.

SOLVED

rte format plugin

Avatar

Level 4

Hi,

i need to modify the structure of the plugin format of a rte. Is it possible to change the tag B to the tag STRONG?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi 

The Approach that you would need to achieve this is Overlay.

The approach of copying the relevant js, /libs/cq/ui/rte/core/commands/DefaultFormatting.js and adding it under the apps content folder, /apps/cq/ui/rte/core/commands/DefaultFormatting.js I then amended the copy of DefaultFormatting.js copied under apps. AEM then seems to use the 'overlay' technique to apply the strong tag.

Look at this Stackoverflow link :- http://stackoverflow.com/questions/17946117/strong-tag-getting-replaced-to-b-tag-in-cq5

//

you can update the map with an identity mapping (i.e. map b tags to b tags) so that nothing gets changed.

Add an htmlRules node like the following to your dialog.xml (as a sibling of the rtePlugins node):

...<rtePlugins jcr:primaryType="nt:unstructured">...<misctoolsjcr:primaryType="nt:unstructured"features="sourceedit"/></rtePlugins><htmlRules jcr:primaryType="nt:unstructured"><docType jcr:primaryType="nt:unstructured"><typeConfig jcr:primaryType="nt:unstructured"><semanticMarkupMap jcr:primaryType="nt:unstructured"b="b"i="i"/></typeConfig></docType></htmlRules>... ...

or you can add nodes directly to your dialog in CRXDE Lite if you're not using maven or something similar (this screenshot shows the default, unmodified <i> to <em> mapping -- don't forget to change that if that's not what you want):

CRXDE Lite node view

 

And to understand Overlay example :- http://experience-aem.blogspot.in/2014/02/aem-cq-56-extend-richtext-editor-add-new-plugin-pullquote....

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

3 Replies

Avatar

Level 9

Yes, it is. But you have to develop a custom plugin for that. And use it in RTE.  for more information about AEM RTE. here is the doc.

https://docs.adobe.com/docs/en/aem/6-1/administer/operations/page-authoring/rich-text-editor.html

--

jitendra

Avatar

Correct answer by
Administrator

Hi 

The Approach that you would need to achieve this is Overlay.

The approach of copying the relevant js, /libs/cq/ui/rte/core/commands/DefaultFormatting.js and adding it under the apps content folder, /apps/cq/ui/rte/core/commands/DefaultFormatting.js I then amended the copy of DefaultFormatting.js copied under apps. AEM then seems to use the 'overlay' technique to apply the strong tag.

Look at this Stackoverflow link :- http://stackoverflow.com/questions/17946117/strong-tag-getting-replaced-to-b-tag-in-cq5

//

you can update the map with an identity mapping (i.e. map b tags to b tags) so that nothing gets changed.

Add an htmlRules node like the following to your dialog.xml (as a sibling of the rtePlugins node):

...<rtePlugins jcr:primaryType="nt:unstructured">...<misctoolsjcr:primaryType="nt:unstructured"features="sourceedit"/></rtePlugins><htmlRules jcr:primaryType="nt:unstructured"><docType jcr:primaryType="nt:unstructured"><typeConfig jcr:primaryType="nt:unstructured"><semanticMarkupMap jcr:primaryType="nt:unstructured"b="b"i="i"/></typeConfig></docType></htmlRules>... ...

or you can add nodes directly to your dialog in CRXDE Lite if you're not using maven or something similar (this screenshot shows the default, unmodified <i> to <em> mapping -- don't forget to change that if that's not what you want):

CRXDE Lite node view

 

And to understand Overlay example :- http://experience-aem.blogspot.in/2014/02/aem-cq-56-extend-richtext-editor-add-new-plugin-pullquote....

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni