Hello,
I've been really pleased as to how the ckeditor module is somewhat "smart" about applying a theme's css within the editor. When you choose "use theme css" for the editor css option (admin/settings/ckeditor/edit/profilename) it aggregates all the theme css files it can find... across base and subthemes, etc. This is great.
However, getting your own custom css "overrides", that apply just to the editor (force the background to be white, etc...), is still a bit tricky. Sure you have the config.extraCss
js configuration variable, and you can always manually define your own editor css files, but it seems to me that is would be handy if ckeditor automatically looked in your active theme directory for a "ckeditor.css" file, and also factored that in when you choose the "use theme css" option. It already checks for a "ckeditor.css" file in the module directory, so why not look for on in the theme's directory too?
It's nice to have the option to keep everything tied to the active theme, and it's always nice to avoid lots of js customizations and tweaks. I've also found that the config.extraCss
js configuration variable has some limitations (see #834228: Need to change background of toolbar dropdowns using theme css & Kama skin) and that there is no easy way to manually set your editor css to be smart about base/subthemes (without defining absolute paths) in the way the "use theme css" option does.
Anyway, the attached (tiny) patch tells ckeditor to also check for a ckeditor.css file in the active theme if the "use theme css" option is selected. Does anyone else see a value in this?
Ryan
Comment | File | Size | Author |
---|---|---|---|
ckeditor_check_theme_dir_for_styles.patch | 768 bytes | rjacobs | |
Comments
Comment #1
nbchip CreditAttribution: nbchip commentedIts good idea. Also its usefull to have option of choosing which of enabled themes u want to be using in editor.
Comment #2
pdcarto CreditAttribution: pdcarto commented+1 on being able to choose which theme to have the editor use since many of us use an admin theme for node editing, but want "wysiwyg" to mean what the user sees in the public theme.
Comment #3
dczepierga CreditAttribution: dczepierga commented@rjacobs, thx for patch i commit it to CVS and port also to D7 version.
Please check the latest dev release and let me know if you notice any poblems with it. Remember to clear Drupal cache and browsers cache before testing.
@nbcip, @pdcarto - if u have any feature requests pls create new tickets.
Greetings
Comment #4
mkesicki CreditAttribution: mkesicki commented