CKEditor config

edited October 2013 in Modules
Hi,

I'm trying to find out where Fuel selects the $config['ck_editor_settings'] setting in My_fuel.php for the CKEditor in use. I'd like to have a different tool bar available and feel the easiest way to do that would be by offering an alternative config array.

I've looked through Form_builder.php, Fuel_custom_fields.php, Form.php, but can't find anywhere in there that it writes the code to call CKEditor, or even where it uses that array.

Any thoughts?

Thanks,
Chris.

Comments

  • edited 8:56AM
    That value gets merged in the fuel_header_jqx.php file and Fuel_admin file. It sets a javascript variable called "jqx_config.ckeditorConfig" which gets passed to CKEditor in the custom_fields.js file on the "fuel.fields.wysiwyg_field" method on line 108 in FUEL 1.0.
  • edited 8:56AM
    Perfect! I added a second $config of 'ck_editor_settings1' (for lack of originality) to My_Fuel.php
    Then added to $this->load->module_view(FUEL_FOLDER, '_blocks/fuel_header_jqx', array('editor_config' => 'ck_editor_settings1')); to my form view file.

    Finally, I updated fuel_header_jqx.php with:
    <?php $editor_config_settings = isset($editor_config) ? $editor_config : 'ck_editor_settings'; ?> at the top, and replaced 'ck_editor_settings' with $editor_config_settings in each of the spots in the jqx_config.ckeditorConfig line.

    Voila, I can modify the CKEditor toolbar to my liking in one spot, while keeping other spots normal :)

    Thanks!
  • edited 8:56AM
    I forgot to mention that there is "ckeditor_config" parameter you can use with the wysiwyg field type which takes an associative array. That was missing from the documentation and I just added it. Read that, and perhaps try using that method so you don't have to alter files in the fuel folder. To change the toolbar, you would need to set the textarea's data value before the CKEditor initialization.
    http://docs.getfuelcms.com/general/forms#wysiwyg
Sign In or Register to comment.