2011年6月7日火曜日

django-cmsでTinyMCEのcustomize

settings.pyに
CMS_PLUGIN_TEXT_TINYMCE_CONFIG = {}
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme'] = "advanced"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_buttons1'] = "cut,copy,paste,|,undo,redo,removeformat,|,code,preview,cleanup,|,help,|,hr,charmap,insertdate,inserttime"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_buttons2'] = "styleselect,formatselect,fontselect,fontsizeselect,|,justifyleft,justifycenter,justifyright,"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_buttons3'] = "bold,italic,underline,strikethrough,sub,sup,|,forecolor,backcolor,|,blockquote ,link,unlink,anchor,image,|,bullist,numlist,|,indent,outdent,"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_toolbar_location'] = "top"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_toolbar_align'] = "left"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_statusbar_location'] = "bottom"
CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme_advanced_resizing'] = True

cms/plugins/text/widgets/tinymce_widget.py
assert 'id' in final_attrs, "TinyMCE widget attributes must contain 'id'"
mce_config = cms.plugins.text.settings.TINYMCE_CONFIG.copy()
mce_config.update(get_language_config(self.content_language))
cms/plugins/text/settings.py
if USE_TINYMCE:
    import tinymce.settings
    TINYMCE_CONFIG = getattr(settings, 'CMS_PLUGIN_TEXT_TINYMCE_CONFIG', tinymce.settings.DEFAULT_CONFIG)
となっている。
 CMS_PLUGIN_TEXT_TINYMCE_CONFIG['theme'] = "advanced"
を入れておかないとerror

0 件のコメント:

コメントを投稿