Needs work
Project:
Wysiwyg
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jun 2012 at 12:43 UTC
Updated:
29 Jun 2012 at 08:14 UTC
I'd like to use the CSS files of an existing theme, wich can be done by selecting 'Use theme CSS'
and I'd like to add some exceptions to it by specifying the path to an extra CSS file.
To make this work, I had to alter the inc file of my editor.
Eg. in ckeditor.inc :
Change
if ($config['css_setting'] == 'theme') {
$settings['contentsCss'] = wysiwyg_get_css();
}
elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
$settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())));
}
to
if ($config['css_setting'] == 'theme') {
$settings['contentsCss'] = wysiwyg_get_css();
} else {
$settings['contentsCss'] = array();
}
if (isset($config['css_path'])) {
$contentsCss = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())));
$settings['contentsCss'] = array_merge($settings['contentsCss'], $contentsCss);
}
Still TODO: change the descriptions of the admin form fields accordingly and provide a decent patch.
Comments
Comment #1
twodHmm, you could also override the contentsCss setting in hook_wysiwyg_editor_settings_alter(), would that suffice?
If we add this feature, it would need to default to the current behavior and perhaps include a checkbox to toggle merging in the custom list with the theme stylesheets.