2014-01-12 11 views
1

ckeditor에 자동 증가 플러그인을 사용하려고합니다. 내가 장고와 ckeditor 처음으로 나는 구성에 문제가 있습니다. 내 설정이 인식되지 않습니다. 다음은 단계 목록입니다. 나는 ckeditor를 다시 작성해야한다는 언급을 보았습니다. 이것이 필요한지 나는 모른다.djangocms-text-ckeditor를 사용하여 자동 증가 플러그인 구성

플랫폼 : Ubuntu, django-cms 3 beta, djangocms-text-ckeditor (virtualenv에 설치된 pip 사용), python 2.7.

정확히 무엇을해야할지 모르겠지만 어쨌든 다음을 변경했습니다.

i1. 프로젝트의 settings.py에서

CKEDITOR_SETTINGS = getattr(settings, 'CKEDITOR_SETTINGS', { 
    'config.autoGrow_onStartup': True, 
    'config.autoGrow_minHeight': 200, 
    'config.autoGrow_maxHeight': 400, 
}) 

S2

을 추가했다. ../site-packages/django_text_ckeditor/static/ckeditor/config.js에서
CKEDITOR.editorConfig = function(config) { 
// Define changes to default configuration here. For example: 
// config.language = 'fr'; 
// config.uiColor = '#AADC6E'; 
    config.autoGrow_onStartup = true; 
    config.autoGrow_minHeight = 2000; 
    config.autoGrow_maxHeight = 4000; 
}; 

S3

을 편집했다.

에 자동 증가 플러그인 폴더를 추가

S4 "를 ../site-packages/django_text_ckeditor/static/ckeditor/plugins/autogrow".

"../site-packages/django_text_ckeditor/static/js/cms.ckeditor.js" 

'extraPlugins'변형 된 라인 (45) 'cmsplugins, 자동 증가'

S5.

라인 (58) 이후 추가로 문을 추가

// this is line 58 
CKEDITOR.plugins.addExternal('cmsplugins', settings.static_url + 'ckeditor_plugins/cmsplugins/'); 
// this is the added line 
CKEDITOR.plugins.addExternal('autogrow', settings.static_url + 'ckeditor/plugins/autogrow'); 

다른 무엇을해야할지 모르겠다 "../site-packages/django_text_ckeditor/static/js/cms.ckeditor.js" ? 생각? 조언? 여기에서 표준 장고 - ckeditor를 사용

답변

1

I'am : https://github.com/django-ckeditor/django-ckeditor

귀하의 단계 S2와 S4와 S5는 필요하지 않습니다. ckeditor의 소스를 수정하는 것은 아무런 의미가 없습니다. http://ckeditor.com/addon/autogrow에서 autogrow 플러그인을 다운로드하고 settings.py로 설정하십시오 :

CKEDITOR_CONFIGS = { 
    'default': { 
     'autoGrow_onStartup': True, 
     'autoGrow_minHeight': 100, 
     'autoGrow_maxHeight': 650, 
     'extraPlugins': 'autogrow', 
      'toolbar': 'Custom', 
      'toolbar_Custom': [ 
      ['Bold', 'Italic', 'Underline'], 
      ['Format'], 
      #['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], 
      ['Link', 'Unlink'], 
      ['RemoveFormat', 'Source'] 
     ], 
    } 
}