Expand my Community achievements bar.

SOLVED

AEM 6 | richtext xtype removing html element's attribute

Avatar

Level 4

Hi,

I have a component developed in AEM 6. one of the field has richtext as xtype. The issue I am facing is when I author this field with html data(using source edit), on the page some of the HTML element attributes are getting removed.

 

for example,

If I add below html code

<div data-hide="...">some content</div>

and when I veiw the source of finally rendered HTML page, data-hide property is missing!!

 

how to resolve this issue?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Radha Krishna,

   Currently only supports the basic html tags and not custom one. Verify html serializer/processor /at libs/cq/ui/widgets/source/widgets/form/rte . This basically means that unsupported HTML that was entered will get stripped/removed.

As a workaround, i will suggest that you create a custom plain HTML component that is suitable for your use case and not use the Richtext. Another possibility is to create a new plugin to support such a use case.

Thanks,
Sham
 Tweet: @adobe_sham

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi Radha Krishna,

   Currently only supports the basic html tags and not custom one. Verify html serializer/processor /at libs/cq/ui/widgets/source/widgets/form/rte . This basically means that unsupported HTML that was entered will get stripped/removed.

As a workaround, i will suggest that you create a custom plain HTML component that is suitable for your use case and not use the Richtext. Another possibility is to create a new plugin to support such a use case.

Thanks,
Sham
 Tweet: @adobe_sham

Avatar

Level 10

Is the element hidden or gone - for example -- if you use JQuery for example to read the element:

var $dvObj = $('div.desc');

is a value returned?