CKEditor Web - How To Display and Save Formatted Text

Hello,

I'm trying this forge component to create a Mail Template Generator.

My question is what data type should i save the formatted text into database? and how I can display it in formatted text back in the screen?

Thank you.

Solution

Hi Kevin,

If you can not garrantuee the text is less then 2000 characters you should use data type binary.

Preferable in a 1-to-1 entity related to the original entity.

You then need from the Binary data extension the actions to convert text to binary prior to saving it, and convert it from binary to text when reading it.

For that I would advice to create entity created update wrappers, to isolate these actions.

You do not mention the forge component but you can shoe data which is in HTML format easily through an expression on the screen.

You can use a expression with the property "escape content" set to "No".

But you need to be careful because users can include <script> tags and harmful code in text input since you aren't escaping the text.

Regards,

Daniel

Solution

Hi Kevin,


I am supposing you are developing a reactive web app. For Display and Save Formatted Text into database you can use CKEditor forge. I am sharing link which you can use to save formatted text. 


After install the forge component you just need to add dependency into your application. there are two UI Flows into dependency. One is CKEditor to save data into db and another for display save text db to screen.   

There are multiple set of client actions which will be use to get & set formatted text. 


I hope it will be useful to you. 


Thanks   



 


Thanks for the answer Daniel, works as wonder :) !


Hi Jitender,

I'm currently learning about using it in reactive as web but a bit confusion due to additional client action in reactive version. Thanks for pointing out which to use!

Kevin Wie wrote:

Thanks for the answer Daniel, works as wonder :) !


Hi Jitender,

I'm currently learning about using it in reactive as web but a bit confusion due to additional client action in reactive version. Thanks for pointing out which to use!

Your welcome.