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

P tag remove from the text components AEM

Avatar

Level 4

We want to remove the default p tag .

we are using the text components very heavily.

add our custom css to them. so in drop down we select the style and load that text component.

I want to remove the default p tage getting added.

below is my dialog.xml

<?xml version="1.0" encoding="UTF-8"?>

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

    jcr:primaryType="cq:Dialog"

    xtype="dialog">

    <items

        jcr:primaryType="cq:Widget"

        xtype="tabpanel">

      

    

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

            <tab1

                jcr:primaryType="cq:Panel"

                title="Title, Text, Asset">

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

                    <title

                        jcr:primaryType="cq:Widget"

                        allowBlank="true"

                        fieldDescription="Enter a title"

                        fieldLabel="Title:"

                        name="./title"

                        xtype="textfield"/>

                    <titleSize

                        jcr:primaryType="cq:Widget"

                        allowBlank="true"

                        fieldDescription="In pixels"

                        fieldLabel="Title Font Size:"

                        name="./titleSize"

                        xtype="numberfield"/>

                    <view

                        jcr:primaryType="cq:Widget"

                        fieldLabel="View:"

                        name="./view"

                        sortDir="ASC"

                        type="select"

                        xtype="selection">

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

                            <megaNavView

                                jcr:primaryType="nt:unstructured"

                                text="Mega Nav View"

                                value="megaNavView"/>

                            <articleView

                                jcr:primaryType="nt:unstructured"

                                text="Article View"

                                value="articleView"/>

                            <homepageView

                                jcr:primaryType="nt:unstructured"

                                text="Homepage View"

                                value="homepageView"/>

                            <categoryHeaderView

                                jcr:primaryType="nt:unstructured"

                                text="Category Header View"

                                value="categoryHeaderView"/>

                            <breadcrumbView

                                jcr:primaryType="nt:unstructured"

                                text="Breadcrumb View"

                                value="breadcrumbView"/>

                            <rhmView

                                jcr:primaryType="nt:unstructured"

                                text="RHM View"

                                value="rhmView"/>

                            <caseStudyView

                                jcr:primaryType="nt:unstructured"

                                text="Case Study View"

                                value="caseStudyView"/>

                            <authorView

                                jcr:primaryType="nt:unstructured"

                                text="Author View"

                                value="authorView"/>

                            <imageRightView

                                jcr:primaryType="nt:unstructured"

                                text="Image Right View"

                                value="imageRightView"/>

                            <imageLeftView

                                jcr:primaryType="nt:unstructured"

                                text="Image Left View"

                                value="imageLeftView"/>

                            <featuredStatView

                                jcr:primaryType="nt:unstructured"

                                text="Featured Stat View"

                                value="featuredStatView"/>

                            <textRightView

                                jcr:primaryType="nt:unstructured"

                                text="Text Right View"

                                value="textRightView"/>

                            <textLeftView

                                jcr:primaryType="nt:unstructured"

                                text="Text Left View"

                                value="textLeftView"/>

                            <featuredContentView

                                jcr:primaryType="nt:unstructured"

                                text="Featured Content View"

                                value="featuredContentView"/>

                            <curvedImageView

                                jcr:primaryType="nt:unstructured"

                                text="Curved Image View"

                                value="curvedImageView"/>

                             <borderTextView

                                jcr:primaryType="nt:unstructured"

                                text="Text Border View"

                                value="borderTextView"/>

                              <normalBoldTextView

                                jcr:primaryType="nt:unstructured"

                                text="Normal Bold Text"

                                value="normalBoldTextView"

                               />

                              <redBoldText

                                jcr:primaryType="nt:unstructured"

                                text="Red Bold Text"

                                value="redBoldText"

                                />

                               <subTitleView

                                jcr:primaryType="nt:unstructured"

                                text="Sub title"

                                value="subTitleView"

                                />

                             

                              

                         

                        </options>

                     

                

                 

                </items>

            </tab1>

        </items>

      

      

    </items>

</jcr:root>

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, if you wish to remove the p-tag, in AEM there's a solution where you'd use AEM sling models, to remove specific tags that you do not want from the rich text editor. Find the full tutorial here https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-...

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi, if you wish to remove the p-tag, in AEM there's a solution where you'd use AEM sling models, to remove specific tags that you do not want from the rich text editor. Find the full tutorial here https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-...