django admin tinymce for part of textareas -
i'm using django admin + grappelli + tinymce grappelli.
it works perfect, can't figure out how make admin form textareas , apply tinymce part of them.
for example, i've 2 fields: description , meta-description. need tinymce description , need textarea without tinymce meta-descrption.
tinymce in admin enabled via form this:
class adminform(forms.modelform): def __init__(self, *args, **kwargs): """sets list of tags string""" instance = kwargs.get('instance', none) if instance: init = kwargs.get('initial', {}) kwargs['initial'] = init super(adminform, self).__init__(*args, **kwargs) class media: js = ( settings.static_url + 'grappelli/tinymce/jscripts/tiny_mce/tiny_mce.js', settings.static_url + 'grappelli/tinymce_setup/tinymce_setup.js', )
and enabled in admin.py:
class modeladmin(admin.modeladmin): form = adminform
it looks behaviour described in beginning of tinymce init:
tinymce.init({ mode: 'textareas', theme: 'advanced', skin: 'grappelli', ...
is there way solve issue?
by setting mode textareas
, won't give sort of selector control 1 applies editor to. you'll need drop mode
setting , go selector
: http://www.tinymce.com/wiki.php/configuration:selector
the django-tinymce config options mirror tinymce's settings.
Comments
Post a Comment