Hi guys, I using Kentico MVC version 12. My question is : Can I automatically add widgets which specified after creating pages? If it's so, can I remove them from pages as well? Thanks
Hi Kyle,
It sounds like you might want to use MVC page templates, you can configure MVC page templates to have a predefined list of widgets. Then when you create a page, or modify an existing page you can load in the template's widgets.
I'd recommend you check the developing page templates in MVC page in the K12 documentation. https://docs.kentico.com/k12sp/developing-websites/page-builder-development/developing-page-templates-in-mvc
After loading an MVC page template, you can remove the preloaded widgets on that page as you wish.
I believe the only easy option is to utilize MVC Page Templates. From the Default MVC Page Template you can create a Custom Page Template which effectively will be a page with your default widgets. When you create a page from custom template Kentico copies default widgets to a newly created page and then these widgets can be edited or deleted.
Thanks for your advice, Liam and Dmitry. I wonder if this solution still working with the Widget in MVC?
Dear Kyle, what we have posted is specifically for MVC. Please check the docs linked and note the top left corner - there is a switch between MVC and Portal Engine, and it says that "This page is only available for the MVC development model".
Please, sign in to be able to submit a new answer.