Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#6 | editor-fix_documentation-2750591-4.patch | 538 bytes | RunePhilosof |
|
Comments
Comment #2
ron_s CreditAttribution: ron_s commentedI 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: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.
Comment #3
aDarkling CreditAttribution: aDarkling as a volunteer commentedYeah, 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
Comment #4
RunePhilosof CreditAttribution: RunePhilosof commentedPatch fixes the documentation in comments for
hook_editor_ckeditor_css_alter()
inmodules/editor_ckeditor/editor_ckeditor.api.php
Comment #5
ron_s CreditAttribution: ron_s commented@RunePhilosof, is there supposed to be a patch attached for review?
Comment #6
RunePhilosof CreditAttribution: RunePhilosof commentedYou are correct :)
Comment #7
Devin Carlson CreditAttribution: Devin Carlson commentedThanks for the patch! Committed to Editor 7.x-1.x.