2012-01-24 3 views
3

내 웹 사이트 용으로 작은 webapp을 만들고 시각적 편집기로 tinyMCE를 포함 시켰습니다. 내 사이트는 무료 템플릿을 사용하고 contentarea는 거의 모든 스타일을 참조하는 #left_side라는 ID가 있으며 관련성이 있습니다.tinymce 편집기 콘텐츠의 스타일이 올바르지 않음

그래서 편집기는 일종의 wysiwyg이지만 스타일은 잘못되었습니다. 왜냐하면 content_css로 제공 한 내 스타일이 적합하지 않기 때문입니다.

#left_side id가 iframe의 어느 부분에도 없기 때문에 그럴 것이라고 가정합니다.

나는 지금 꽤 많은 시간 동안 인터넷 검색을했고, tinyMCE에 편집자 내용에 대해이 ID를 가진 div를 추가 할 방법이 없다는 것을 알았 기 때문에 CSS가 작동 할 것이다.

나는 현재 단지 아무 생각이 없다, 그것을 달성하기 어렵다 생각하지 어떻게 ... : -/

어떤 아이디어가?

편집 : 컨텐츠 CSS는 다음과 같이 추가됩니다 그것에 대해

tinyMCE.init({ 
    // General options 
    mode : "textareas", 
    theme : "advanced", 
    plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave", 

    // Theme options 
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", 
    theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", 
    theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", 
    theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", 
    theme_advanced_toolbar_location : "top", 
    theme_advanced_toolbar_align : "left", 
    theme_advanced_statusbar_location : "bottom", 
    theme_advanced_resizing : true, 

    // Example content CSS (should be your site CSS) 
    content_css : "/cms/static/style/site.css", 
    .... 
+0

어떻게 content_css를 설정 했습니까? 당신의 tinymce init – Thariama

답변

4

이 확실하지,하지만 그것을 할 수있는 다음 구성 옵션 어쩌면 하나. http://www.tinymce.com/wiki.php/Configuration:body_class

스카이프에서 내 다른 의견을 참조하십시오.

+0

을 제공하십시오! 감사! "body_class"로 문제가 해결되었지만 템플릿과 CSS에서 ID에서 클래스로 전환해야했지만 문제는 없습니다. –

+0

TinyMCE에는 body_id 옵션도 있습니다. – arlomedia

+0

멋진데, 큰 도움이되었습니다. – Alex