Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Add superscript tag dynamically

samr99530769
Level 3
Level 3

All, I have a problem statement where webhe have supposed to show ® as superscript.But this has not been aded by content author so now am trying to update dynamically . Is there any suggested approach

AEM
1 Accepted Solution
BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@samr99530769, you can inject this XML block into your touchUI cq_dialog.xml

<subsuperscript
   jcr:primaryType="nt:unstructured"
   features="*"/>

Full list of richText options can be found here, https://gist.github.com/briankasingli/1a7e3e12deaa2e076645b09d30039b46

 

View solution in original post

4 Replies
shelly-goel
Community Advisor
Community Advisor

@samr99530769  To update the content programmatically, you can create a custom servlet which can take content path as input and then using QueryBuilder/ QueryManger find all the nodes under the specified path that contains the character to be superscripted.

Iterate through the list of nodes and parse the "text" property and update the property adding <sup> </sup> tags around the character using string operations. Save the node and replicate if needed.

Query would be something like this: SELECT * FROM [nt:base] AS s WHERE ISDESCENDANTNODE([/content/<your-site-path>]) and CONTAINS(s.*, '<string to be superscripted>')

KiranVedantam1992
Community Advisor
Community Advisor

Superscript is a plugin that is available in RTE. You can enable and author it as per your requirement.

 

Advantages:

Authoring activity

No code changes

One time activity

No technical knowledge needed

 

Disadvantages:

Time-consuming

 

Reference: https://experienceleague.adobe.com/docs/experience-manager-65/administering/operations/rich-text-edi...

 

If you want to add it programmatically, you need to search the nodes that need the tag to be added and update the node.

 

Pros:

Less time consuming

 

Cons:

Depending upon the content, the updation might take time and might impact the server performance

As this is one-time activity (hopefully) the code is useless next time

 

Thanks,

Kiran Vedantam

vanegi
Employee
Employee

Hi @samr99530769

You can install the package that contains a Touch UI component that uses the RTE including superscript tag plugin as described in below documentation link. 

 

More details at:

https://helpx.adobe.com/experience-manager/using/touchUI_RTE_configure.html#:~:text=You%20can%20crea...

 

Thanks!!

BrianKasingli
Correct answer by
Community Advisor
Community Advisor

@samr99530769, you can inject this XML block into your touchUI cq_dialog.xml

<subsuperscript
   jcr:primaryType="nt:unstructured"
   features="*"/>

Full list of richText options can be found here, https://gist.github.com/briankasingli/1a7e3e12deaa2e076645b09d30039b46

 

View solution in original post