Django-ckeditor 样式
Django-ckeditor styling
CONFIG中有一个选项:
CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono',
# 'skin': 'office2013',
...
但实际上我什至无法切换到 office2013
主题,我只有白色方块。
有没有办法启用其他主题?
一级:
必须下载office2013主题的CkEditor
二级:
models.py
class Post(models.Model):
title = models.CharField(max_length=500, verbose_name=_('Title'), blank=True)
message = models.TextField(max_length=50000, verbose_name=_('Message'), blank=True)
admin.py
class PostModelAdmin(admin.ModelAdmin):
formfield_overrides = { models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, }
class Media:
js = ('ckeditor/ckeditor.js',) # The , at the end of this list IS important.
css = {
'all': ('ckeditor/contents.css',)
}
admin.site.register(Post, PostModelAdmin)
django-ckeditor 仅随 moono 皮肤一起提供。你需要下载你想要的皮肤,并把它放在你的静态目录中:
%STATIC_DIR%/ckeditor/ckeditor/skins/
CONFIG中有一个选项:
CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono',
# 'skin': 'office2013',
...
但实际上我什至无法切换到 office2013
主题,我只有白色方块。
有没有办法启用其他主题?
一级: 必须下载office2013主题的CkEditor
二级:
models.py
class Post(models.Model):
title = models.CharField(max_length=500, verbose_name=_('Title'), blank=True)
message = models.TextField(max_length=50000, verbose_name=_('Message'), blank=True)
admin.py
class PostModelAdmin(admin.ModelAdmin):
formfield_overrides = { models.TextField: {'widget': forms.Textarea(attrs={'class':'ckeditor'})}, }
class Media:
js = ('ckeditor/ckeditor.js',) # The , at the end of this list IS important.
css = {
'all': ('ckeditor/contents.css',)
}
admin.site.register(Post, PostModelAdmin)
django-ckeditor 仅随 moono 皮肤一起提供。你需要下载你想要的皮肤,并把它放在你的静态目录中:
%STATIC_DIR%/ckeditor/ckeditor/skins/