Web Parts with custom Zone

Ron Truex asked on May 15, 2018 21:07

So I am trying to create a web part that has a zone into it. Basically, I have a web part that I want to create a zone that I can allow it to be a widget so that a user could edit certain properties. This way an admin could add the web part, and then give the user the ability to edit it like a widget. It would be really nice if I could almost have the widget load itself which to a degree should be possible.

Currently I have a method that uses editable text regions to partially accomplish this, but it would be nicer if I could figure out more of a way to have this handled like a widget when editing the page and a webpart when in design. The idea would be to lock the zone to just be the 1 widget so an editor could not remove it or add others to mess with the overall design.

Recent Answers


Peter Mogilnitski answered on May 16, 2018 03:04 (last edited on May 16, 2018 03:34)

Why not to create a zone, make it widget zone and use widgets in there?

1 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on May 16, 2018 14:58

If you are trying to make your own Layout Webpart/widget, you can download my Bootstrap Layout tool and take a look at how i do that. Even that though was just a modification of the "Columns" Layout tool that Kentico has, it has the different needed code pieces in it that you can modify.

If you just don't know that you can create widget zones like Peter has linked to, then go with that.

0 votesVote for this answer Mark as a Correct answer

Ron Truex answered on May 16, 2018 18:56

I thought about doing a widget zone, I am having some issues with the menus. So when the page loads all of the context menus work perfectly, but if you scroll they do not update. So depending on how far you scroll you could have to click on the menu and then scroll back up. I have tried it on a general blank template with rows and still had the issue. I am getting a js error of VM8591 GetResource.ashx:6 Uncaught Error: Load timeout for modules: jQuery,Underscore … http://requirejs.org/docs/errors.html#timeout at makeError (GetResource.ashx?scriptfile=~%2fCMSScripts%2fRequireJS%2frequire.js:6) at tt (GetResource.ashx?scriptfile=~%2fCMSScripts%2fRequireJS%2frequire.js:6) at GetResource.ashx?scriptfile=~%2fCMSScripts%2fRequireJS%2frequire.js:6

So I am trying to avoid the widget zone, plus an editor could remove it/add some.

@Trevor I will have to check your bootstrap out. I thought about looking at the columns/row concept. Just seems cumbersome because of how they are doing it by adding the table and all that. I thought of trying to add a widget via JS and seeing what that would do. Just would think there would be a better way.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on May 17, 2018 02:20

I would look to why the javascript error is there before reinventing the proverbial wheel. Did you modify or upgrade the kentico solution at some point? Do you see these errors on a empty master page template with a widget zone? It is either the Kentico files are messed up or there is some javascript loading from your site that is hurting it.

0 votesVote for this answer Mark as a Correct answer

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