htmly icon indicating copy to clipboard operation
htmly copied to clipboard

How to change editor

Open Ricco-S opened this issue 7 years ago • 9 comments

Hello is it possible to change the editor to ckeditor or tinyMCE or bootstrap editor with source code options ?

Ricco-S avatar May 28 '17 05:05 Ricco-S

http://summernote.org/

Ricco-S avatar May 28 '17 06:05 Ricco-S

Well, the current editor allows HTML but you should use markdown as much as you can to format your texts.

CodeAlDente avatar May 28 '17 16:05 CodeAlDente

i know but markdown support no div with classes..

Ricco-S avatar May 28 '17 17:05 Ricco-S

I fully understand your point of view.

Sometimes I really like to use different colors to highlight a specific part in a text. But this is not what markdown is for. It keeps everything simple and clean in a way so we can take the output 1:1 into a plaintext without losing the meaning of the text.

A really good point to deal with this would be by creating a new post type "HTML" where we can use pure HTML along with a WYSIWYG editor like the one you described.

CodeAlDente avatar May 28 '17 17:05 CodeAlDente

I know what markdown is for. Please understand. Some People need sometimes a litle bit more as only clean text and highlight this text..

So it was pretty if admin can switch the editor.

The htmly sytem is very nice but the markdown is create clean output but is not very cool.

Ricco-S avatar May 28 '17 17:05 Ricco-S

Hi i have it.

Ricco-S avatar Jun 02 '17 05:06 Ricco-S

Anybody able to integrate with CKEditor or Summernote ?

vvcares avatar Mar 04 '20 14:03 vvcares

Fairly simple to replace the markdown editor with CKEditor. Not sure the markdown supporters will even like the thought, but some people need a little more than markdown can offer. In the classroom, CKEditor is all we use, so had to try adding it during my testing of HTMLY.

Our installs are never accessible from the internet and they cannot access the internet, so not worried about security. Maybe the creator can chime in and say if there is security issue.

This is purely a test and you would still need to disable/remove Markdown.Editor.js.

First thing you need to add ckeditor js in files add-content-html.php and edit-content.html.php:

<script src="https://cdn.ckeditor.com/4.16.0/standard/ckeditor.js"></script>

Second thing is disable the the markdown editor in add-content-html.php and edit-content.html.php (temp solution):

<!--<div id="wmd-button-bar" class="wmd-button-bar"></div>-->

Third is add the script to activate for textarea. I placed it right before closing div that contains the texarea. Needs to be in both above files:

<script>
CKEDITOR.replace( 'content', {
allowedContent: true,
});
</script>

That is it. The allowedContent: true will setup so you can use things like YouTube iframe embeds (we do not use - only sharing for online users).

At this point you will have an error in console about Markdown.Editor.js which I assume can be removed. If I recall, this removed the image upload function, so keep that in mind. There may be other issues, but I only wanted to demonstrate that fairly simple to add CKEditor support.

Now the issue is all your changes will be gone on next update of HTMLY:)

oleteacher avatar Apr 24 '21 21:04 oleteacher

open system\admin\views and extract this file

add-content-html.php and edit-content.html.php

file.zip

dirmanhana avatar May 13 '21 13:05 dirmanhana

This issue is too old, I will close this one. Please create new issue for possible improvements. Thanks

danpros avatar Jan 07 '24 07:01 danpros