How can I make for Widgets available in Tutorial site

Michael Keller asked on May 31, 2019 14:53

Hi everyone

it's a complete beginner question (that's probably why I could not find an answer). I followed the mvc tutorial (https://docs.kentico.com/k12tutorial/mvc-development/displaying-the-page-content) - now I created an editableArea which I can also see in the editor. But - I only see "Forms" as a widget. But when I browse the widgets in the system, there are a lot of them. How can I enable more of them? e.g. a Product List or just a simple content element?

Best regards Michael

Correct Answer

Dmitry Bastron answered on May 31, 2019 15:35

Hi Michael,

You mentined you can see lots of widgets. Are they in "Widgets" application? If so, these Widgets are for Portal Engine websites (it's Web Forms, not MVC). And out of the box within Kentico 12 MVC there is only one Form widget. Other widgets you need to create manually in the code. You can follow this article to learn more hot to create widgets.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Rui Wang answered on May 31, 2019 15:42 (last edited on May 31, 2019 15:44)

The widgets you see in widgets application within the Admin UI are for portal development just like the web parts. They are not for MVC.

After you have created widget in your MVC project and registered the widget, they will all appear if you add this line into the VIEW .cshtml

@Html.Kentico().EditableArea("area1")

If you want to specify certain widgets to be available to an area, you can do this

@Html.Kentico().EditableArea(
    "area2",
    allowedWidgets: new[] { "DancingGoat.General.TextWidget", "DancingGoat.HomePage.ImageWidget", "DancingGoat.Widgets.KCCafeWidget", "DancingGoat.General.HTMLWidget" }
)
2 votesVote for this answer Mark as a Correct answer

Michael Keller answered on May 31, 2019 16:06

Thanks! While this is unfortunate - it makes sense! I hope there will be such a big library for MVC widgets - that would allow very quick development!

0 votesVote for this answer Mark as a Correct answer

Rui Wang answered on May 31, 2019 16:12

Michael, the service pack for V12 coming our in late June will have more generic out of box widgets. But since everyone's need is different when it comes to MVC, it doesn't make sense for Kentico to create tons of widgets which lead to low usage & high maintenance. So the service pack will also include more standard form controls which can make your widgets creation experience much better.

0 votesVote for this answer Mark as a Correct answer

Michael Keller answered on May 31, 2019 16:14

ok cool - and yes, you're probably right

0 votesVote for this answer Mark as a Correct answer

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