1

I want to limit the formatting options for the wagtail.wagtailcore.fields.RichTextField field. For example, how to limit the user so that he can only use bold, paragraph and links in the RichTextField. I found examples for extending the editor, but not for limiting.

yvess
  • 1,992
  • 19
  • 17
  • This discussion might help: https://groups.google.com/d/msg/wagtail/PERl4ffbkiE/mmA4-OhACgAJ – gasman Mar 08 '17 at 09:26
  • this is now obsolete, with the new draftail editor its build-in see [wagtail editing_interface](http://docs.wagtail.io/en/v2.1/advanced_topics/customisation/page_editing_interface.html) – yvess Jun 22 '18 at 08:33

1 Answers1

0

You can limit options for RichTextField in wagtail by using keyword features as follows.

body = RichTextField(features=['bold','link'])

The list of all the available features are as follows:

  • h1, h2, h3, h4, h5, h6 - heading elements
  • bold, italic - bold / italic text
  • ol, ul - ordered / unordered lists
  • hr - horizontal rules
  • link - page, external and email links
  • document-link - links to documents
  • image - embedded images
  • embed - embedded media (see Embedded content)

Example and detail description can be found in it's official site.

Bikash kharel
  • 472
  • 7
  • 16