Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace textarea with rich text editor in Flask Admin [closed]

Tags:

python

flask

I'd like to know the best way to replace a standard textarea field with a rich text editor in Flask Admin? How about kindeditor? And how to make it ?

like image 454
winoi Avatar asked Mar 18 '13 12:03

winoi


Video Answer


1 Answers

Here is how you can do it: https://gist.github.com/mrjoes/5189850

Even though this example shows how to integrate CKEditor, process won't be very different for another WYSIWYG editor:

  1. Create wtforms widget which will emit necessary HTML for the editor. For CKEditor it is 'ckeditor' class;
  2. Create wtforms field which uses this widget
  3. Create new template which will include editor JS file(s)
  4. Tell Flask-Admin to use new field and template.
like image 186
Joes Avatar answered Nov 13 '22 02:11

Joes