Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
453 stars 600 forks source link

Dynamic RTE - <p> tags are not removed #328

Closed kkedem closed 9 years ago

kkedem commented 10 years ago

Hi,

I have seen an article that talks about RTE customization : http://blogs.adobe.com/contentmanagement/tag/custom-richtext/

8th customization in that link talks about removing paragraph tags from the RTE text. It recommends to add a parameter called 'removeSingleParagraphContainter' on the RTE widget and that will take care of

tags. It is working as expected if I include 'richtext' xtype in dailogue but the same thing is not working when I include the parameter through Dynamic RTE configurations.

My configuration was like this:

text: {
xtype: "slingscriptinclude",
jcr:primaryType: "cq:Widget",
script: "rte.custom-rich-text.primaryheadline1.json?removeSingleParagraphContainter=true&defaultValue=There is some text&hideLabel=true&externalStyleSheets=/apps/dcom/dm/components/pages/dcompage/clientlibs-shared-header/css/rte-style.css.jsp"
}

It was still adding parahraph tags.

kkedem commented 10 years ago

@davidjgonzalez : Any idea about this?

davidjgonzalez commented 10 years ago

@kkedem Looking at the code it seems like this would work. Can you try three things:

1) Copy/Paste in the JSON response retrieve for this text node (the full Widget JSON) -- you should be able to find this in your browsers Network traffic tools 2) Can you try setting this removeSingleParagraphContainer = true on the "named" RTE config under /etc/designs .. (aka does it work if its not added via Req params) 3) Can you try setting removeSingleParagraphContainer = {String}true (Not boolean property) on a normal widget config node and see if it works.

The RTE Servlet returns all values as Strings, so depending on the JS check, the String value might be confusing it; we may need a special case to handle this param similarly to externalStyleSheets

davidjgonzalez commented 10 years ago

@kkedem any luck getting the above info?

kkedem commented 10 years ago

Hey David,

I'm currently out of office. I'll ask my team verify and let you know. Thanks. On Oct 8, 2014 11:50 AM, "david g." notifications@github.com wrote:

@kkedem https://github.com/kkedem any luck getting the above info?

— Reply to this email directly or view it on GitHub https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/328#issuecomment-58389029 .

davidjgonzalez commented 10 years ago

@kkedem any luck?

justinedelson commented 10 years ago

For what it is worth, when you add that removeSingleParagraphContainer, I can see that it is passed correctly through the various RTE JavaScript classes. So I'm inclined to say that this isn't a Dynamic RTE issue, but the testing @davidjgonzalez suggested will prove that out.

davidjgonzalez commented 10 years ago

@kkedem Were you able to verify? Or should we close this ticket?