Forum

Thread tagged as: Question, Addons, CKEditor

CKEditor Adding Plugins - Code Snippet

Greetings, I'm having trouble adding a plugin to the ckeditor, specifically the Code Snippet plugin. https://ckeditor.com/addon/codesnippet

I tried adding it manually, the the documentation on that is a little sparse. Basically I added the CKE plugin into its plugin folder then added:

config.extraPlugins = 'codesnippet';

to ckeditor/config.js

Also I added the Widget plugin as it seems to be a dependency for the Code Snippet plugin

config.extraPlugins = 'widget,codesnippet';

This did not work. I then tried out the CKE builder https://ckeditor.com/builder

This did not work either.

How/can I add this Code Snippet plugin to be used through Perch?

Many thanks -Nick

Nicholas Nelson

Nicholas Nelson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'm not sure if that file is used or not - I'm no expert on CKEditor, it's not our product.

You can certainly add configuration directives in the _config.inc file - that's where I added mine for the file upload stuff.

Hmm I'm fairly novice in PHP, so I don't really understand what to do with that file. I can fall back on something like highlight.js or prism.js for the presentation on the live site. Was hoping to use the CKE plugin as it seems rather slick.

Do you/anyone happen to know if there is a difference in the way the CKE plugin in implemented in Perch vs their typical build?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

No, we just package it for Perch so any suggestions made by them should be able to be implemented.

I've added plugins to CKEditor (code snippet being one of them),

I just used the builder, then replaced all the files except

uploader.php _config.inc

As they are Perch files, I think they're the only ones they added