Search code examples
djangobootstrap-5summernote

Django Summernote Settings


I've installed django-summernote and most of it works fine except for the dropdown buttons for Style, Font Size, Color and Table. The example has them setup as follows:

...
'toolbar': [
     ...
     ['style', ['style'],
     ['fontsize', ['fontsize']],
     ['color', ['color']],
     ['table', ['table']],
     ...
],

I have tried placing a list of possible values, for example, a list of colors in color:

['color', ['black', 'red']],

But this clearly isn't correct as the button doesn't show at all if I try entering a list of possible values.

I have noticed that if I copy in any formatted text and select it, the fontsize button does display the actual size I copied but gives me no way to change it from the toolbar and my only option for sizing text is to use CTRL+1/2/3/4/5/6 for the relevant format as H1 to 6 whereas the examples shown online clearly have working dropdowns.

I am using bs5 SUMMERNOTE_THEME = 'bs5' theme and have tried various config's in settings.py but nothing seems to enable the dropdowns. I have tried copying the scripts from various discussion groups and tutorials discussing summernote to no avail and checked all my settings and they all appear to be fine.

It is saving any included media files correctly and all the other buttons work 100%.

Cheers,

Simon


Solution

  • Just change your theme bs5 to bs4 in your settings.py

    SUMMERNOTE_THEME = 'bs4'