Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

CKEDITOR - Prevent to remove i tags regarding font awesome

edited January 2017 in Feature Requests
Hi, I need to add this statement: CKEDITOR.dtd.$removeEmpty['i'] = false
to the fuelCMS ckeditor configuration. I can´t find the way to add this.
Here is the suggested hack to fix it: http://stackoverflow.com/questions/18250404/ckeditor-strips-i-tag

Thanks a lot!

Comments

  • Edit ./fuel/modules/fuel/assets/js/editors/ckeditor/config.js. Add CKEDITOR.dtd.$removeEmpty['i'] = false; inside the last closing bracket ("}")

    I have that exact fix working. Take care though. CKEditor's javascript does weird caching things in browsers so don't panic or doubt yourself if you think it doesn't work. Clear your caches, restart the browser etc. should get it to kick at some point.

    Another handy hint for FontAwesome, add:
    $config['xtra_css'] = array('font-awesome.min.css');
    to your MY_fuel.php config file

    Also, create a ./assets/css/ckeditor.css, reference the fontawesome css in it and add/edit editors.php config file's
    $config['ckeditor']['default'] = array( 'contentsCss' => WEB_PATH.'assets/css/ckeditor.css' );

    All that should give you FontAwesome inside the Fuel interface and CKEditor.
  • edited 3:42PM
    Awesome! Thanks a lot!
  • edited 3:42PM
    When you say "reference the fontawesome css" , means import the fontawsome css? i´m not fully understand it.
  • edited 3:42PM
    Hey! This is working fine, i did import the css and goes great!
    I added the removeEmpty["i"] because i was losing the image when switching to html source code from the toolbar. But, upon add the statement ( and cleared cache as you suggested) the error still sitting here.

    Thank you for your help!
Sign In or Register to comment.