CKEditor Styles in dropdown

edited December 2011 in Modules
How do you set styles for the dropdown in CKEditor as seen here http://docs.cksource.com/CKEditor_3.x/Howto/Styles_List_Customization

Can you do this from the MY_fuel.php config, or do you have to hack the page layout and run the CKEDITOR.stylesSet.add manually?

Comments

  • edited 12:21PM
    Setting it in MY_fuel I don't think will work. You could create a js file and put your logic in there and then include it using a module's "js" configuration property. If it is an existing module, like "pages" you can use $config['module_overwrites']['pages']['js'] = array('my_js.js'); in your MY_fuel_modules.php file.

    Alternatively, you could try adding that style info to the fuel/modules/fuel/assets/js/editors/ckeditor/config.js file.
  • edited 12:21PM
    I'm now loading a custom JS file for Fuel. Tried putting this in it

    CKEDITOR.stylesSet.add( 'my_style',
    [
    // Block-level styles
    { name : 'Paragraph' , element : 'p' },
    { name : 'Heading 1 awe' , element : 'h1' }
    ]);

    No luck. Also tried adding

    'stylesSet'=>'my_style'

    to $config['ck_editor_settings']

    No luck there either. Looking at CKEDITOR in the console shows that the style set is added, but it seems like it's ignoring anything I add in the dropdown.

    Maybe this is a question for the CKEditor guys though.
  • edited 12:21PM
    Any luck adding it to the ckeditor/config.js file?
  • edited 12:21PM
    Tried putting the config in there and naming it "default", no luck; although, the browser is loading that file. Also tried the ckeditor/plugis/styles/styles/default.js Again, loads it, but no change.

    Interesting though, it is sourcing my 'contentsCss' from the MY_fuel.php config, so the styles are right, I just can't change which tags it's displaying in the dropdown so I get the default "Heading 1, Heading 2 ..."
Sign In or Register to comment.