Jump to content

[Resolved] FCK Editor vs Font Awesome Fix


zombiesbyte

Recommended Posts

Hi Guys

Just thought I'd post a solution to an issue I was facing. I couldn't find any solutions on here so thought this may come in handy for anyone facing the same problem.

In the admin area of CC, if you try to use a Font Awesome (or any element that uses <i> I believe) FCK Editor (the WYSIWYG / Rich Text Editor) it will strip these tags without warning. I just happened to notice they were missing today so here's the fix:

In your /includes/ckeditor folder there should be a config.js file. Add the following line at the bottom before the closing brace:

	// ALLOW <i></i>
	config.protectedSource.push(/<i[^>]*><\/i>/g);

So for a clearer idea for those who don't do a lot of programming here's the default updated version:

/**
 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function( config ) {
	config.filebrowserBrowseUrl = document.location.pathname+'?_g=filemanager&mode=fck';
	config.protectedSource.push(/{[\s\S]*?}/g);
	config.extraPlugins = 'showprotected';
	config.filebrowserWindowHeight  = 500;
	config.filebrowserWindowWidth  = 650;
	config.allowedContent = true;
	
	// ALLOW <i></i>
	config.protectedSource.push(/<i[^>]*><\/i>/g);
};

One final thing is that the editor may have cached the previous settings so I would advise a clear out of your browser history or Ctrl + F5 a few times with the editor open in your admin area before inserting your font-awesome icons into the source code view. Remember to switch back from source view to normal view before saving and testing your new awesome page :)

Happy days

Cheers

James

 

Mod: I think this is an open and close thread so feel free to mark it so :hiya:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...