Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION Modify or Replace CKEditor
#24
Dear GS Users and Developers,
dear shawn_a and Felix:


For all the interested I will post my very, very basic - but working - plugin for SunEditor version 2.23.4 and try to describe step by step how to go about using it.
I did it with version 3.3.10 of GS. Yes, I know I should have used the latest version, but I tried to press on and this one was already installed on my localhost.

1) Head to https://github.com/JiHong88/SunEditor and download SunEditor-master.zip by clicking on the green button labeled "Clone or download" and choosing "Download ZIP" in the small box which opens below the green button.

2) In principle, you have many choices where to save and extract the to be downloaded ZIP file. I chose the path .../admin/template/js because there is also the folder ckeditor.
So, download "SunEditor-master.zip" in the folder js and extract it there. The complete path to the folder will be then .../admin/template/js/SunEditor-master.

3) In the path SunEditor-master/dist/ open the file suneditor.min.js with an editor (say, Notepad++) and replace the code 
else t+=e.replace(/(?!>)\s+?(?=<)/g,""); 
with 
else t+=e.replace(/(?!>)\s+?(?=<)/g," ");
and the odd nbsp behavior I mentioned in my last post is gone. The developer of SunEditor knows what changes I made.
(Note: I simply wanted to add this file to this post, but this forum software didn't allow js files and files larger than 200 kB, that's why you have to do the changes yourself.)

4) In the path SunEditor-master/dist/css/ delete the file suneditor.min.css and replace it with the file suneditor.min.css (same name) I added to this post. This css file contains some changes which were necessary to get a better integration of SunEditor with GS.

5) Open your GS website (preferably on your local computer as there is always the chance for things going haywire ...) and head to admin/settings.php.
Here you find below the heading "User Profile" a checkbox labeled "Enable the HTML editor", which to my knowledge exists for enabling CKEditor.
Uncheck this checkbox and click on "Save Settings".

6) In the path [Your Website] ... /theme/[Your Theme folder]/ open the file header.inc.php in an editor (say, Notepad++).
Example: If you are using the theme Bootstrap3 the last part of the path to the file header.inc.php is .../theme/Bootstrap3/header.inc.php.

7) Having opened the file header.inc.php in an editor you can add the small css file called suneditor_helper.css which makes the use of SunEditor easier resp. helps to utilize its full potential.
The position I used in the header.inc.php file was just before
<?php get_header(); ?>
</head>
If you don't have <?php get_header(); ?> or something with a similar function, then use the position directly above </head>.
What goes into that position?
<link href="<?php get_theme_url(); ?>/css/suneditor_helper.css" rel="stylesheet">
Here, the css file suneditor_helper.css is in the folder "css" in the folder of my theme ("Bootstrap3") which itself is in the folder called "theme", giving the path .../theme/Bootstrap3/css/suneditor_helper.css.
You can always create a folder called "css" in the folder of your theme to emulate this situation if there is none - or you can use your own path.

8) Copy the plugin called "SunEditor_for_GS.php" from this post and put it in the usual plugins folder of your GS installation and activate it in the usual way in the path .../admin/plugins.php.

9) Navigate to .../admin/pages.php and find SunEditor at the ready when creating or editing pages.

It would be great if you were as kind as to report how SunEditor works for you and what problems you experienced with installing it in GS.


Best regards
Samson

_____________________________

Downloads from Github (https://github.com/JiHong88/SunEditor):
SunEditor-master.zip

Downloads from this post: 
.css   suneditor.min.css (Size: 51.68 KB / Downloads: 6)
.css   suneditor_helper.css (Size: 2.2 KB / Downloads: 6)
.php   SunEditor_for_GS.php (Size: 4.59 KB / Downloads: 7)
Reply


Messages In This Thread
Modify or Replace CKEditor - by Samson - 2019-09-30, 19:42:09
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-02, 00:25:38
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-02, 00:26:38
Thank you: Modify or Replace CKEditor - by Samson - 2019-10-02, 04:01:36
RE: Modify or Replace CKEditor - by Felix - 2019-10-02, 05:06:04
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 08:50:32
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:11:07
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:14:17
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:15:25
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:16:59
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:21:39
RE: Modify or Replace CKEditor - by Samson - 2019-10-02, 09:23:17
RE: Modify or Replace CKEditor - by datiswous - 2019-10-03, 19:09:41
RE: Modify or Replace CKEditor - by Samson - 2019-10-04, 01:33:56
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-05, 04:47:51
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-05, 05:03:14
RE: Modify or Replace CKEditor - by Samson - 2019-10-05, 06:06:39
RE: Modify or Replace CKEditor - by shawn_a - 2019-10-05, 06:18:31
RE: Modify or Replace CKEditor - by Felix - 2019-10-05, 09:52:48
RE: Modify or Replace CKEditor - by Samson - 2020-01-05, 22:27:23
RE: Modify or Replace CKEditor - by Samson - 2020-01-07, 08:12:34
RE: Modify or Replace CKEditor - by Samson - 2020-01-12, 08:52:56
Installing SunEditor - Plugin and Files - Step by Step - by Samson - 2020-01-14, 08:35:53
RE: Modify or Replace CKEditor - by Samson - 2020-01-15, 02:21:58



Users browsing this thread: 1 Guest(s)