holmescreek

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

3 posts in this topic

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

Share this post


Link to post
Share on other sites

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.

2 people like this

Share this post


Link to post
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!

2 people like this

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By JimSee
      FIRST: I am brand new and am trying to add a Navigation Tree to the beginner site. When I put renderNavTree($page, 4) into _head.php, I get a menu list like the graphic.
      This is great EXCEPT, I don't know how to make a horizontal menu out of it with CSS. Can someone help (please) or direct me to an example of the css?
      SECOND: That list is great for the Home page but when I click "program," the list only shows:

      How can I get the whole (visible) menu on every page?
      Thank you in advance! jim
       
    • By billjoseph
      Weirdest thing just happened to me.  I updated blank site from 3.0.42 to 3.0.61 then started adding fields.  I have two instances of FieldsetOpen areas in the template, and a few CKEditor textareas (both inside those fieldsets and outside). 
      I added an image field to the template and placed it near the top of the template fields.  Once I did that I was unable to toggle either Fieldset, and the CKEditor stopped working.
      When I moved the image field to the bottom of the template fields, the CKEditor loaded, but the fieldsets still wouldn't toggle.  When I deleted the image field, the editor and toggle return to normal.  (Adding a new image field re-introduces the issues.)
      I've tried adjusting the settings on the image field but the result is the same - even with all default settings.  I tried adding an image field to a different template - same result.
      What am I missing here?
    • By Harmen
      Hi all,
      I do have a form in the 'backend' of my website which has a fieldtype of ASMSelect. I gave all the options of that field a custom attribute with a value:
      foreach ($feature_group['features'] as $feature_id => $feature) { $field->addOption($feature_id, $feature['name'], array('data-feature_group' => $feature_group_id)); } How can I read out the value of that custom attribute named data-feature group?
      I've tried it with
      $selected_feature_groups = $form->get($category_id)->getAttribute('data-feature_group'); //AND selected_feature_groups = $form->get($category_id)->feature_group; but that doesn't work.
      How can I get this to work?
      ~Harmen
    • By Jozsef
      Hi everyone, I'd like to start a conversation about your view and practices for profitable web design and development (unless there is already one that I didn't find). I use ProcessWire for most of my sites currently.
      Wherever I look though I can see plenty of web design freelancers and even larger agencies running exclusively on WordPress and themes. Many people are running "web design" businesses even without any development skills. There are just so many that I started to doubt if that's the way to go.
      - Do you use Wordpress + themes to cut cost and increase your bottom line? If yes, what is the middle ground? Is it worth to put up with WP?
      - If not, what alternatives you use for micro/small businesses?
      - And finally, how do you use ProcessWire to speed up small, basic brochure websites?
      Clients care more about budget and results than "custom" design. I love working with ProcessWire but only if it doesn't mean lost opportunities.
      Any opinions are welcome, especially from those of you who are advocates for themes yet are skilled developers.
    • By zota
      Hi,
      installing a CKEditor plugin seems easy:
      - download,
      - extract to /site/modules/InputfieldCKEditor/plugins/[folder with the plugin name will sit here/]
      - on admin setup > fields > any field that works with CKEditor > tab Input > scroll down and you will see the new plugin waiting activation:

      Ooops, only shows the default extra plugins...
      What am I missing?
      Thanks
      EDIT: it was a simple permission problem. One should check and change the permissions of downloaded stuff...