Hi,

I was trying to include some stylesheets and .js files to my CkEditor. So like function/_ckeditor_theme_css/8 I added this to my theme.info.yml:

ckeditor_stylesheets[] = css/style.css

but this had no effect. In fact it destroys yml. I think it should be something like this?

ckeditor_stylesheets:
   - css/style.css
   - css/another.css

And is it possible to also add custom .js?

Thanks a lot!

Comments

gstout’s picture

I added style sheets as you suggested but sadly it had no effect.

--
Greg

remydenton’s picture

Not sure about how one would add js, but I can confirm that the documentation for _ckeditor_theme_css() is outdated—it references .info files, which have been replaced by .info.yml files. The correct documentation for adding a ckeditor stylesheet can be found here: hook_ckeditor_css_alter() .

afoster’s picture

You can add css styles into your Front End Theme (Even if you are using your admin theme to edit content) by adding this to theme.info.yml So this shows your front-end theme's css in ckeditor in your admin theme...

[front-end-theme.info.yml]

ckeditor_stylesheets:
- css/style.css
- css/other.css

To create the JS loading in the ckeditor I think you'd need to create a custom module...

joshuautley’s picture

Thank YOU! I was a little confused on where and how but now I got it working. (=

Josh Utley, President & CEO
Intrepid Network Inc. | Multimedia Services & Business Solutions

"Our mission is to provide a more personable multimedia service along with the highest quality business solutions."

bajah1701’s picture

Do you mind sharing how you were able to achieve it?