python - how to enable a plugin within django-tinymce? -
i have started using tinymce in django project. need enable plugins come bundled django-tinymce (for example, template). so, within settings.py, have added following configuration:
tinymce_default_config = { 'theme': 'advanced', 'relative_urls': false, 'plugins': 'template', 'toolbar': 'template' } max_upload_size = 512000
thinking might enable template plugin, seems not. how enable plugin within django-tinymce? have not found anywhere.
thanks suggestions!
update:
i think had misunderstood how configuration done. have created config.js configuration:
tinymce.init({ theme: 'advanced', plugins: 'template', height: '350px', width: '1000px' });
then, have linked mymodeladmin.media. (i'm loading editor django-admin.)
class mymodeladmin(modeladmin): class media: django.conf import settings js = ( settings.static_url + 'tiny_mce/config.js', )
config.js seems loading correctly, can't see difference.
you can pass mce_attrs param tinymce widget tinymce configuration.
from django import forms django.contrib.flatpages.models import flatpage tinymce.widgets import tinymce class flatpageform(forms.modelform): content = forms.charfield(widget=tinymce(mce_attrs={ 'theme': 'advanced', 'plugins': 'template', 'height': '350px', 'width': '1000px' })) class meta: model = flatpage
Comments
Post a Comment