Expand my Community achievements bar.

SOLVED

RTE Text Component - plaintext

Avatar

Level 7

Hi,

Is there a way to make an text/RTE component store plain text as opposed to HTML?

I realise that this is a strange question given it would make the rich text features such as bold and italic completely useless!

I want the author experience of the RTE editor and want to be able to add custom plugins but the result should be plaintext.

Alternatively is there an example of a customizable text editor in a dialog that allows for plugins/custom functionality that can store in plain text?

Thanks,

Jim

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Not sure why you want to add plain text using Rich Text Editor.

If you want to add plain text you can go for Textarea — Granite UI 1.0 documentation

Or in RTE without p tag then you can add removeSingleParagraphContainer :true It will only remove first p tag.

Or If you need to show RTE HTML tag instead of rendered RTE then don't use @ context='html' in HTL.

You can also try to create hidden field. where you can read RTE from RichText as plain text using jQuery and as plain text in hidden field.



Arun Patidar

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Not sure why you want to add plain text using Rich Text Editor.

If you want to add plain text you can go for Textarea — Granite UI 1.0 documentation

Or in RTE without p tag then you can add removeSingleParagraphContainer :true It will only remove first p tag.

Or If you need to show RTE HTML tag instead of rendered RTE then don't use @ context='html' in HTL.

You can also try to create hidden field. where you can read RTE from RichText as plain text using jQuery and as plain text in hidden field.



Arun Patidar