CKEditor Mode

edited July 2016 in Modules
So when using CKEditor mode and {fuel_var('var name')} you don't actually see it, it comments it out.
Something like "My name is: {fuel_var('my name')}" becomes "My name is: " I actually though CKEditor removed it until I clicked the source button.

Is there no way around that?

Comments

  • edited 7:02AM
    There is a CKEditor config parameter of "protectedSource". The fuel/application/config/editors.php file lists it but is commented out because it takes an array of regular expressions, and regex doesn't translate into JSON very well. The wysiwyg field type has an editor_config parameter that you may want to use or you can use Javascript to set it before initialization:
    <script>jQuery(function(){ fuel.fields.setElementData("my_field", "editor", { 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' } ], protectedSource: ['/<\?[\s\S]*?\?>/g'] }); });</script>
    http://docs.getfuelcms.com/general/forms#wysiwyg
Sign In or Register to comment.