0

I'm using ckeditor, I'm reading from a database a template, which contains html code css and js

The problem is that when using:

CKEDITOR.replace ('description');

The css code of the template, is merged with the code of the web page, then the web page takes the styles I read from the template and break the styles.

What I should do, is that the ckeditor takes the css only he, and not the web page.

My configuration is:

CKEDITOR.editorConfig = function( config ) {
    config.toolbarGroups = [
        { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
        { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
        { name: 'links' },
        { name: 'insert' },
        { name: 'forms' },
        { name: 'tools' },
        { name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
        { name: 'others' },
        { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
        { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
        { name: 'styles' },
        { name: 'colors' },
        { name: 'about' }
    ];
    config.removeButtons = 'Underline,Subscript,Superscript';
    config.format_tags = 'p;h1;h2;h3;pre';
    config.removeDialogTabs = 'image:advanced;link:advanced';
};

can anybody help me?

Thanks

  • Please edit your question and show CKeditor configuration. – SaidbakR Jul 25 '17 at 23:01
  • @SaidbakR ready, if you can, please review this gif: [link] https://lh3.googleusercontent.com/-F5pk63mbIJU/WXfV3uDnC8I/AAAAAAAADfE/5b17hEZFQsYOnFLP1iSrPmlFWtO--z8GwCL0BGAYYCw/h521/ckeditor.gif , thanks – Diego Guerrero Jul 25 '17 at 23:38
  • Quick hack might be to use `!important` https://stackoverflow.com/questions/9245353/what-does-important-in-css-mean – Will Jul 26 '17 at 00:11
  • So, your issue is: the custom style of the rendered text in the editor may override the page's style? @DiegoGuerrero – SaidbakR Jul 26 '17 at 09:04
  • However, checkout [this page](http://ckeditor.com/forums/CKEditor-3.x/CSS-style-sheet-for-content-area) it may help you. – SaidbakR Jul 26 '17 at 09:13

0 Answers0