romanvm / django-tinymce4-lite

TinyMCE 4 editor widget for Django
MIT License
126 stars 47 forks source link

Multiple Timymce toolbars settings #54

Open gusarg81 opened 5 years ago

gusarg81 commented 5 years ago

Hi,

Is there a way to setup mutiple settings? Leys say I want one tinyce settings (specially, the toolbar) for the admin section of my site and another for the public section (users).

Thanks.

merwok commented 5 years ago

I couldn’t find the reference in the docs, but this works:


class SomeModel(models.Model):
    content = HTMLField(profile=dict_with_settings)
gusarg81 commented 5 years ago

Hi!

Thanks for reply. Would it work when I set the widget from the ModelForm? Since I always use:

widgets = { 'message': TinyMCE() }

merwok commented 5 years ago

Ah in that case you’d need to pass the right param (I forget if it’s profile or mce_something) to the TinyMCE widget class.

gusarg81 commented 5 years ago

Maybe mce_attrs?

EDIT: well, it just works with profile as well (when tested the first time didn't work, maybe a typo).

widgets = {'message': TinyMCE(profile=settings.TINYMCE_BASIC_CONFIG)}

merwok commented 4 years ago

So it this a doc issue, or should be closed?

gusarg81 commented 4 years ago

This should be documented, I think.