我正在使用 django CKeditor 插件。我的配置如下:
CKEDITOR_CONFIGS = {
'default': {
'skin': 'moono', #'office2013'
'toolbar': 'Custom', #selects from below
'toolbar_Custom': [
['Bold', 'Italic', 'Underline', 'Strike', 'Subscript']
],
'toolbar_simple': {
'skin': 'moono',
'toolbar': 'Custom',
'toolbar_Custom': [
['Bold', 'Italic', 'Underline'],
['NumberedList', 'BulletedList'],
],
},
'toolbar_basic': {
'toolbar': 'Basic'
},
'toolbar_full': {
'toolbar': 'full',
},
}
我有时需要显示简单的工具栏,有时需要显示完整的工具栏。我该怎么做?
我希望有这样的选项:
directions_car = RichTextField("Directions by car", max_length=1000, blank=False, default="", uses="toolbar_Custom")
最佳答案
您可以使用config_name
属性来设置不同的工具栏。
directions_car = RichTextField("Directions by car", max_length=1000, blank=False, default="", config_name="toolbar_Custom")
关于django - 使用 Django CKeditor,如何在不同的字段上加载不同的工具栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40408029/