Hi!

I'm trying to include Bootstrap (front end theme) in the CKEditor iframe.
I tried a test using:
ckeditor_stylesheets[] = css/main.css
as specified in the comments for hook_editor_ckeditor_css_alter(). It didn't work. The iframe just loads as usual without any custom css. Tried clearing the site cache as well as the browser cache.

Any suggestions?
Also, is there any way to load Bootstrap via CDN with this method?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aDarkling created an issue. See original summary.

ron_s’s picture

I don't believe this is correct. I was able to get it to work using the hook_editor_ckeditor_css_alter function as documented in api.php:

function hook_editor_ckeditor_css_alter(array &$css, $format) {
  $css[] = drupal_get_path('module', 'mymodule') . '/css/mymodule-ckeditor.css';
}

All you have to do is include the path to the CSS file and its name. If the file is located in a theme, use the theme location instead of a module.

aDarkling’s picture

Yeah, you put me on the right path. The code comments were wrong.
The correct line to put into the .info file was
editor_ckeditor_stylesheets[] = css/main.css

RunePhilosof’s picture

Assigned: Unassigned » RunePhilosof
Category: Support request » Bug report
Status: Active » Needs review

Patch fixes the documentation in comments for hook_editor_ckeditor_css_alter() in modules/editor_ckeditor/editor_ckeditor.api.php

ron_s’s picture

@RunePhilosof, is there supposed to be a patch attached for review?

RunePhilosof’s picture

You are correct :)

Devin Carlson’s picture

Status: Needs review » Fixed

Thanks for the patch! Committed to Editor 7.x-1.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.