Using Portal Engine Inline Widgets in the MVC development model

Michael Legacy asked on April 22, 2019 18:04

Just a general question, can you use inline widgets (that can be added through the standard Kentico WYSIWYG editor) in the MVC dev model? A site i'm working on is Kentico 12 MVC, but we want to build some inline widgets for use in the WYSIWYG editors in the CONTENT tab, not on the page builder.

I don't have much Portal Engine experience, mostly have worked with the MVC model. I am following the portal engine docs for adding a Widget Web Part and then the widget itself, but the files don't seem to be saving to the CMS project in ~/CMSWebParts/FolderName/Widget.ascx (or whatever folder I set).

The main goal here is for main content to be handled in the "Content" tab. We want to add some widgets so that content editors can add nice little cards to break up long content.

Correct Answer

Juraj Ondrus answered on April 23, 2019 13:37

You cannot use portal engine widgets in the MVC model as they are completely different platforms. Also, the inline widgets you have added, most likely on the Content tab of the page, is not supported. Well, we left that button in the toolbar by mistake. In this case, you need to create your custom resolver and resolve the widget syntax in your MVC code. I am sorry for the confusion.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on April 22, 2019 18:09

The included widgets are based on Portal Engine, you'd have to build your own widgets specifically for the Page Builder using MVC in order for them to work.

2 votesVote for this answer Mark as a Correct answer

Michael Legacy answered on April 22, 2019 18:12 (last edited on April 22, 2019 18:13)

Yes, I'm aware of how to build page builder widgets.

I want to build an inline widget for use on the standard WYSIWYG editors on the CONTENT tab not the PAGE tab. Just wondering if that's even an option with the MVC dev model. I don't see anything in the documentation on it.

0 votesVote for this answer Mark as a Correct answer

Michael Legacy answered on April 22, 2019 20:01

I've gotten the Widget built in Kentico, but adding it through the Editor renders like this:

{^widget|(name)InlineCardLayout|(Image)%7e%2fgetmedia%2ffb194b21-2cd6-40c8-acfe-eec7761d75fc%2fdoctor-and-patient.jpg%3fwidth%3d700%26height%3d466%26ext%3d.jpg|(TextContent)Testing+Text+Content|(widget_displayname)Inline+Card^}

I've found some articles referencing this:

Resolving Dynamic Controls

But the CMS.Base.Web.UI namespace does not seem to be included in the MVC project. (only namespace off CMS.Base is CMS.Base.Internal) Any tips?

0 votesVote for this answer Mark as a Correct answer

Michael Legacy answered on April 23, 2019 15:48

Thanks Juraj!

I think extending CKEditor to just include a custom formatter might be easier from the sounds of it.

0 votesVote for this answer Mark as a Correct answer

Lee Conlin answered on August 9, 2019 10:32

You can use portal engine widgets inline in rich-text areas with MVC if you have a way of parsing them out.

Check out https://github.com/hades200082/Kentico12-MVC-WidgetResolver for a way to do that in MVC.

0 votesVote for this answer Mark as a Correct answer

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