Kentico 12 MVC - CKeditor for widgets

Sebastian Hahn asked on January 30, 2019 11:23

Hello,

is it possible to use the CKeditor in an MVC Application for widgets (as an inline editor)? I would like to insert images from a media gallery and insert internal links (page tree) and external links.

kind regards

Recent Answers


Juraj Ondrus answered on January 30, 2019 12:32

Hi,
Yes, it should be possible - but you need to integrate the CKEditor into your widget properties and inline editors using your own code. Something like creating custom form component.

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on January 30, 2019 15:50

You have to create your own Inline Property editor. docs.kentico.com/.../defining-widget-properties-in-mvc#DefiningwidgetpropertiesinMVC-Implementinginlinepropertyeditors

I recently wrote a Blog post implementing the Alloy Editor in K12. Which is build upon the CKEditor, devdavid.nl/.../creating-an-inline-editor-in-kentico-12

0 votesVote for this answer Mark as a Correct answer

Sebastian Hahn answered on January 30, 2019 16:01

Hi David,

we have already implemented the CKEditor as an inline Property editor. As mentioned in the original post, the missing feature is to insert/browse/update images or to select URL from the page tree (as seen as the CKEditor in the Content tab). The CMS plugin is not working as intended.

0 votesVote for this answer Mark as a Correct answer

Marshall Annis answered on February 25, 2019 22:41 (last edited on February 25, 2019 22:41)

David -- Thanks for sharing your blog post. I've been trying to follow along, but am running in to some console errors when adding the widget to the page. Can you provide some additional information around where you are putting the js files and other assets for the Alloy Editor? You kind of lost me at this part. Specifically, what to you have in /Scripts/AlloyEditor and what is located in /Content/InlineEditors ?

Sebastian -- I'm also curious to know if you were ever able to find a solution to being able to insert items from the media library or to select pages from the page tree?

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on February 26, 2019 10:19

@Marshall -- I got so much spam that I've disabled comments. Sorry :)

  • My /Scripts/AlloyEditor/ basically contains all assets and configs you'll get from AlloyEditor itself. quickpeek

  • My /Content/InlineEditors/Text2Editor folder (as I named the thing text2editor), contains the script file to configure the editor and handle the events. I see now that I still have the default assets/config folder also there. And it seems there are references in there which require that. I found that most of the references are scattered over the Alloy script files itself. And Since Kentico combines and moves them there might be some broken links.

Image Text

Let me know if you still have questions.


As for the upload images question. This would require a complete custom solution. Since most of these editors just encode the image itself into the page. So it's not even an attachment on the Kentico node. You'd have to facilitate the popup logic for selecting and handling all the media library calls and listing. Sounds like a good blog post ^_^.

1 votesVote for this answer Mark as a Correct answer

web dev answered on October 2, 2019 16:50 (last edited on October 2, 2019 16:53)

actually i tried to add it but didnt work @David te Kloese can you provid a demo

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.