i recently discovered that the "user theme css" setting of wysiwyg is not working with the omega theme (garland for example works perfectly) so i xdebugged the thing

post @wysiwyg issue
http://drupal.org/node/1071754#comment-5088260

the important function how wysiwyg adds css is this small one
as you can see it checks $info['group'] >= CSS_THEME
none of the subthemes css are returned by drupal_add_css() and never processed. the only css processed is the actual grid css you use (fluid-16 narrow-16 ..)


function wysiwyg_get_css() {
static $files;

if (isset($files)) {
return $files;
}
// In node form previews, the theme has not been initialized yet.
if (!empty($_POST)) {
drupal_theme_initialize();
}

$files = array();
foreach (drupal_add_css() as $filepath => $info) {
if ($info['group'] >= CSS_THEME && $info['media'] != 'print') {
if (file_exists($filepath)) {
$files[] = base_path() . $filepath;
}
}
}
return $files;

}

CommentFileSizeAuthor
#11 ckeditor do not wysiwyg.pdf102.47 KBclcl
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

barraponto’s picture

Title: wysiwyg, editor style » CSS styles are not picked up by WYSIWYG module
Version: 7.x-3.0-rc5 » 7.x-3.0
Category: support » bug

Adding injury to insult, usually the grid css defines a min-width, exceeding the text-area and hiding text (particularly right-aligned text). Not tested with -dev, yet.

altrugon’s picture

This is the solution that I have found:

  1. Admin > Configuration > Content authoring > Wysiwyg profiles
  2. Edit your input format
  3. CSS section
    • Editor CSS: Define CSS
    • CSS Path: %b%t/css/global.css (Atention: %t give you the path to the theme folder under /sites, it won't work with profiles, so for profile you have to do %bprofiles/my_profile/...
  4. Save, clean cache (it is always good when working with styles :P), and you are done

I have noticed some inconsistencies with our feature settings, for some reason every time I clean the cache whatever was added to the form get overridden by the feature settings so I have to do the changes directly on the feature file.

Please if this doesn't work for your revisit the settings form and make sure the data that you just added is still there.

dotman’s picture

not working for me.with omega, my subtheme is in site/all theme/my theme and the css in the css folder. My Omega Base theme is in the same as my subtheme. I did clear cach, but not go. Any ideas?

thanks.

malcomio’s picture

The token definition in #2 didn't work for me, but specifying the actual path did, e.g.
/sites/all/themes/mytheme/css/global.css
One thing to bear in mind is that your editor plugin adds CSS, which will affect the way it looks in the editor window unless your styles override them. For example tinyMCE specifes a font size of 10px on body, td, and pre.

Seb_CKSource’s picture

That's right. In CKEditor you can change various font and color elements in the ckeditor/ckeditor/contents.css file.

malcomio’s picture

Status: Active » Fixed
franz’s picture

Status: Fixed » Active

#2 is a workaround, the problem is not fixed.

zabelc’s picture

Neither #2 nor #4 work in all cases. Specifying either one ends up throwing off my site's header

fenstrat’s picture

There's a working solution for using Omega based themes in the WYSIWYG editor, have a look at and try the patch in #1309040-12: Select which theme's CSS to use when choosing 'Use theme CSS' in settings

drupalreggie’s picture

I'm using a sub theme of Omega and the Commerce kickstart installation profile for Drupal 7.

So far I've burned about 2.5 hours this morning trying to implement a Wysiwig editor capable of outputting CSS font styles on my site. I've tried a number of different wysiwig editors all of which appear to run into the same problem. The heading styles from my theme are all picked up (h2, h3, h4 etc.) and can be assigned to text during the editing of a node, yet once i've saved that node and view it the styles do not display.

I've tried setting the input filter profile CSS settings to 'Define CSS' and providing the path to my global.css, both using tokens and absolute paths. I've tried renaming this css file to 'style.css' and placing it in the theme root. This CSS file contains stylings for h2, h3, h4 etc. as well as styles for various other elements.

I've tried using a variety of editors, CKEditor, TinyMCE, OpenWysiswig etc. but after overcoming various problems along the way installing these editors, even once I've got them working the same problem persists.

Is there any reliable way to get this sorted? I'm all out of ideas.

Cheers,
Reg.

clcl’s picture

Project: Omega » Bartik
Version: 7.x-3.0 » 7.x-1.x-dev
Component: Code » Look and Feel
Assigned: Unassigned » clcl
Category: bug » task
Priority: Normal » Critical
FileSize
102.47 KB

I'm using simply bartik and it is just not working. I tried to set CSS settings to 'Define CSS' and providing the path to my global.css.
%bthemes/bartik/css/style.css,%bthemes/bartik/css/layout.css,%bthemes/bartik/css/colors.css

and

themes/bartik/css/style.css,themes/bartik/css/layout.css,themes/bartik/css/colors.css

and

css/style.css,css/layout.css,css/colors.css

and

in fact I want to use the theme settings default.

And it is not working. I get my output on one line without any layout.
Somewhere else they told that it is the ckeditor.zip file. So I installed the versions 3.6, 4.0 and 4.1...

I'm out of ideas and i do not understand all the things they tell on the developers page...

Later one I want to set up geshifiltering for highlighted code tags because my client wants to use code.
It is a fresh drupal installation with the latest version of drupal 7.21 Please some help!

fenstrat’s picture

Project: Bartik » Omega
Version: 7.x-1.x-dev » 7.x-3.0
Component: Look and Feel » Code
Assigned: clcl » Unassigned
Category: task » bug
Priority: Critical » Normal

@clcl Please don't hijack an existing issue. If a search reveals no similar issues then create a new one.

clcl’s picture

Ok, I understand that I can not post here because my problem is that wysiwyg do not work togheter with ckeditor. And I have to find a solution for that first.
So I 'm now at http://drupal.org/node/1853550 where I have aplied a patch for
Drupal 7.22 wysiwyg 7.x-2.2 and the latest full version of ckeditor 4.1
Afterwards I can come back to see how to point to proper css styles.