Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

RTE paraformat formats = add class to tag

Avatar

Level 4

We are need to create paragraph style using and H1 tag with a class.  Under the paraformat/formats node we have a h1 node with property tag = "h1".  How to we append a class on the H1?

1 Accepted Solution

Avatar

Correct answer by
Level 8

The paraformat doesn't allow you to set a class name on the tag. The RTE has a second pluging - Styles which allows you specify a class name to applied to text, however it does so by wrapping the text in a <span> tag. See http://docs.adobe.com/docs/en/aem/6-0/administer/operations/page-authoring/rich-text-editor.html#Sty... (Text) for details. 

View solution in original post

6 Replies

Avatar

Level 4

Anyone know before I escalate to Day Care?  This simple thing is totally undocumented.

Avatar

Level 4

I want to bump this again.  The only answer I've seen is use CSS.  That is not really acceptable.  Surely we can set the width of these fields.

Avatar

Level 10

Most people place style values like this in CSS files and place the CSS files in clientlibs. 

Avatar

Correct answer by
Level 8

The paraformat doesn't allow you to set a class name on the tag. The RTE has a second pluging - Styles which allows you specify a class name to applied to text, however it does so by wrapping the text in a <span> tag. See http://docs.adobe.com/docs/en/aem/6-0/administer/operations/page-authoring/rich-text-editor.html#Sty... (Text) for details. 

Avatar

Level 9

Hi Scott,

Can you please elaborate this? we have classes in clientlibs, how do I add class to have this functionality create a tag like this.

<h1 class="h1class> ... </h1>

Here is what I have for dialog.xml, how 

<paraformat

                            jcr:primaryType="nt:unstructured"

                            features="*">

                            <formats jcr:primaryType="cq:WidgetCollection">

                                 <p jcr:primaryType="nt:unstructured" description="Paragraph" tag="p" />

                                                 <h1 jcr:primaryType="nt:unstructured" description="Heading 1"tag="h1" />

       

                            </formats>

                        </paraformat>

Avatar

Level 4

This has been rough - especially when converting classic RTE plugins to Touch UI RTEs.

Companies have spent a lot of time creating customized RTE functionality and the ability to not quickly convert say, 3 types of blockquotes added to the previous styles in Classic, but converting them to Touch means I have to recreate the entire styles as a span and then move the styles.

It seems that being able to define a Block Level element and a class(es) along with it would be straight forward and standard functionality to any RTE.