1

I am new to configuring CKEditor on Drupal 7, and even with the UI, it has always been a pain. I am trying to have it to stop stripping / removing tags, specifically - code, pre, ins del, blockquote, q, dl, dd, dt. I have a test page which I use to test my site's styles and these are getting removed in both Full and Filtered. Grrrr...

Keep in mind I have no idea what I am doing here. Please help me figure this out so I do not waste another day on this. =(

ACF's extra allowed content

I have added the following there:

br; div; span; header; footer; section; aside; figure; a; img; strong; em; h1; h2; h3; h4; h5; h6; ins; del; cite; q; blockquote; code; pre; table; tr; td; th; thead; tfoot; caption; legend; col; ul; ol; li; dl; dd; dt;</code>

config.js

I have found config.js and added the following to get it to stop stripping out tags.

CKEDITOR.editorConfig = function( config ) 
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.allowedContent = 'br div span;' + 
    'header footer section aside figure;' + 
    'a[!href]; img[!src,alt,width,height];strong em h1 h2 h3 h4 h5 h6;' +
     'ins del cite q blockquote code pre;' +
     'table tr td th thead tfoot caption legend col;' + 
     'ul ol li dl dd dt';
config.extraAllowedContent = ' br div(*) span(*);' + 
    'header footer section aside figure;' + 
    'a[!href]; img[!src,alt,width,height];strong em h1 h2 h3 h4 h5 h6;' +
    'ins del cite q blockquote code pre;' +
     'table tr td th thead tfoot caption legend col;' + 
     'ul ol li dl dd dt';
};
0

If you just want to disable the content filter altogether, you can use:

config.allowedContent = TRUE;

Also, make sure you're clearing your Drupal cache AND browser cache. The CKEditor JS files are heavily cached by the browser and I wasted lots of time banging my head against the wall before I realized this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.