Jump to content

How can I move ckeditor styles.js to another site folder?


John W.
 Share

Recommended Posts

This question has probably been beaten to death - think I'm approaching this wrong. 

Anyway, I've got a textarea input field that uses ckeditor.

Under the fields Input section I managed to add my custom style sheet in the 'Custom Editor CSS File (regular mode) section for instance:

/site/templates/css/ckeditor.css

This seems to work fine.

What I'm trying to do now is add a custom style to the ckeditor styles menu, for instance, called .green_button

(p.s. in the ckeditor styles.js I added this to the inline section : { name: 'Green Button', element: 'a', attributes: { 'class': 'button' } },

 

Ok, onto the problem...

I notice that PW, by default, is using  /wire/modules/inputfield/inputfieldCKEditor/ckeditor-4.5.10/styles.js

So, I copied this into /site/templates/js/mystyles.js

Next, I added the above to the 'Custom Editor JS Styles Set' field, however, it doesn't seem to load myckeditorstyles.js -- rather continues to load the one from the /wire/modules... folder.

I cleared all history and caching in Safari (also tried Chrome, etc).

I'm wondering if there is something else I need to do to have PW load my /site/templates/js/myckeditorstyles.js instead of the one in /wire/modules.../ckeditor-4.5.10/styles.js ?

Thanks!

 

 

Screen Shot 2017-04-20 at 4.26.41 PM.png

Edited by holmescreek
wrong filename in topic title
Link to comment
Share on other sites

On 4/20/2017 at 8:57 PM, Macrura said:

you have to follow the format:

mystyles: /site/modules/etc..

you only have the path; also make sure to change the name of the styleset to add, so it doesn't conflict with the core.

Thanks, that fixed it.  There was a space between mystyles: and /site/modules/ ... the the correct syntax mystyles:/site/... and not mystyles :/site/...

A note for other readers, the Styles drop-down wasn't displaying anything after the change quoted above. However changing the style name in the mystyles.js file 

from:

CKEDITOR.stylesSet.add( 'default', [

to:

CKEDITOR.stylesSet.add( 'mystyles', [

fixed the issue of the styles list being empty.

@Macrura - thanks!

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...