Expand my Community achievements bar.

SOLVED

Adding RTE Plugin in page component dialog

Avatar

Level 4

We need to extend page component dialog and add rich text field into the dialog.

Our requirement is to add RTE plugin like subsuperscript, misctools(enter special characters, edit the HTML source) and etc.

Any comments/advice/help are appriciated.

 

Sincerely,

Keehwan


2021-07-30_1.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@keehwan1 

First create copy cq:dialog structure  from core/page component and then add additional tab and RTE field as resource type.

 

<richtext
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldLabel="Rich Text"
name="./richtext"
removeSingleParagraphContainer="{Boolean}true"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured"> ...............</rtePlugins> <richtext/>

Go through following code snippet....

 

 

<edit
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <findreplace
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <format
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <justify
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <links
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <lists
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <spellcheck
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <styles
        jcr:primaryType="nt:unstructured"
        features="*">
        <styles
            jcr:primaryType="cq:WidgetCollection">
            <test
                jcr:primaryType="nt:unstructured"
                cssName="test"
                text="test"
            />
        </styles>
    </styles>
    <subsuperscript
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <undo
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <misctools jcr:primaryType="nt:unstructured"
        features="*">
        <specialCharsConfig jcr:primaryType="nt:unstructured">
            <chars jcr:primaryType="nt:unstructured">
                <default_copyright
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;copy;"
                    name="copyright"/>
                <default_euro
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;euro;"
                    name="euro"/>
                <default_registered
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;reg;"
                    name="registered"/>
                <default_trademark
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;trade;"
                    name="trademark"/>
            </chars>
        </specialCharsConfig>
    </misctools>
    <paraformat
        jcr:primaryType="nt:unstructured"
        features="*">
        <formats jcr:primaryType="nt:unstructured">
            <default_p
                jcr:primaryType="nt:unstructured"
                description="Paragraph"
                tag="p"/>
            <default_h1
                jcr:primaryType="nt:unstructured"
                description="Heading 1"
                tag="h1"/>
            <default_h2
                jcr:primaryType="nt:unstructured"
                description="Heading 2"
                tag="h2"/>
            <default_h3
                jcr:primaryType="nt:unstructured"
                description="Heading 3"
                tag="h3"/>
            <default_h4
                jcr:primaryType="nt:unstructured"
                description="Heading 4"
                tag="h4"/>
            <default_h5
                jcr:primaryType="nt:unstructured"
                description="Heading 5"
                tag="h5"/>
            <default_h6
                jcr:primaryType="nt:unstructured"
                description="Heading 6"
                tag="h6"/>
            <default_blockquote
                jcr:primaryType="nt:unstructured"
                description="Quote"
                tag="blockquote"/>
            <default_pre
                jcr:primaryType="nt:unstructured"
                description="Preformatted"
                tag="pre"/>
        </formats>
    </paraformat>
    <table
        jcr:primaryType="nt:unstructured"
        features="-">
        <hiddenHeaderConfig
            jcr:primaryType="nt:unstructured"
            hiddenHeaderClassName="cq-wcm-foundation-aria-visuallyhidden"
            hiddenHeaderEditingCSS="cq-RichText-hiddenHeader--editing"/>
    </table>
    <tracklinks
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <image
        jcr:primaryType="nt:unstructured"
        features="*"/>

 

 

 

 

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@keehwan1 

First create copy cq:dialog structure  from core/page component and then add additional tab and RTE field as resource type.

 

<richtext
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldLabel="Rich Text"
name="./richtext"
removeSingleParagraphContainer="{Boolean}true"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins jcr:primaryType="nt:unstructured"> ...............</rtePlugins> <richtext/>

Go through following code snippet....

 

 

<edit
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <findreplace
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <format
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <justify
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <links
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <lists
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <spellcheck
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <styles
        jcr:primaryType="nt:unstructured"
        features="*">
        <styles
            jcr:primaryType="cq:WidgetCollection">
            <test
                jcr:primaryType="nt:unstructured"
                cssName="test"
                text="test"
            />
        </styles>
    </styles>
    <subsuperscript
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <undo
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <misctools jcr:primaryType="nt:unstructured"
        features="*">
        <specialCharsConfig jcr:primaryType="nt:unstructured">
            <chars jcr:primaryType="nt:unstructured">
                <default_copyright
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;copy;"
                    name="copyright"/>
                <default_euro
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;euro;"
                    name="euro"/>
                <default_registered
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;reg;"
                    name="registered"/>
                <default_trademark
                    jcr:primaryType="nt:unstructured"
                    entity="&amp;trade;"
                    name="trademark"/>
            </chars>
        </specialCharsConfig>
    </misctools>
    <paraformat
        jcr:primaryType="nt:unstructured"
        features="*">
        <formats jcr:primaryType="nt:unstructured">
            <default_p
                jcr:primaryType="nt:unstructured"
                description="Paragraph"
                tag="p"/>
            <default_h1
                jcr:primaryType="nt:unstructured"
                description="Heading 1"
                tag="h1"/>
            <default_h2
                jcr:primaryType="nt:unstructured"
                description="Heading 2"
                tag="h2"/>
            <default_h3
                jcr:primaryType="nt:unstructured"
                description="Heading 3"
                tag="h3"/>
            <default_h4
                jcr:primaryType="nt:unstructured"
                description="Heading 4"
                tag="h4"/>
            <default_h5
                jcr:primaryType="nt:unstructured"
                description="Heading 5"
                tag="h5"/>
            <default_h6
                jcr:primaryType="nt:unstructured"
                description="Heading 6"
                tag="h6"/>
            <default_blockquote
                jcr:primaryType="nt:unstructured"
                description="Quote"
                tag="blockquote"/>
            <default_pre
                jcr:primaryType="nt:unstructured"
                description="Preformatted"
                tag="pre"/>
        </formats>
    </paraformat>
    <table
        jcr:primaryType="nt:unstructured"
        features="-">
        <hiddenHeaderConfig
            jcr:primaryType="nt:unstructured"
            hiddenHeaderClassName="cq-wcm-foundation-aria-visuallyhidden"
            hiddenHeaderEditingCSS="cq-RichText-hiddenHeader--editing"/>
    </table>
    <tracklinks
        jcr:primaryType="nt:unstructured"
        features="*"/>
    <image
        jcr:primaryType="nt:unstructured"
        features="*"/>