Custom Webpart/Widget Layouts

Marla Krause asked on July 8, 2015 17:35

I've followed instructions in the documentation about how to create a new webpart by inheriting from an existing webpart. And I understand that I can either use the default layout or create a new layout, however how do I know how the layout needs to be structured? I assumed it would allow me to start with the default layout so that I could see how it was setup, and then modify it from there. Is there somewhere that I can go to see how the default layout is setup? I can't seem to find this in the code that comes with Kentico or in the documentation.



Correct Answer

Marla Krause answered on July 9, 2015 18:23

I ended up having to write a custom web part for this. It turns out that this web part is generating it's HTML within the .cs code by using the Ajax Toolkit to create the tab control.


0 votesVote for this answer Unmark Correct answer

Recent Answers

Roman Hutnyk answered on July 8, 2015 19:48


Navigate original web part in Web Parts section, click edit, switch to Layout tab and click New Layout. This will show you layout form with default layout populated in it. Copy it and do whatever you want to do, but you definitely should leave all server controls there, you might hide them, if don't want them to appear on the view.

Hope this helps.

0 votesVote for this answer Mark as a Correct answer

Marla Krause answered on July 8, 2015 19:54

I feel like I'm missing something, because I do that and all I see is this:

"<%@ Control Language="C#" AutoEventWireup="true" CodeFile="~/CMSWebParts/Layouts/Tabs.ascx.cs" Inherits="CMSWebParts_Layouts_Tabs" %> "

What I'm trying to do is make a new version of the tab control so that I can make it mobile friendly. I'd like to be able to make it into an accordion when the page gets too small. However, the way the tab layout control is rendered it's not possible.

0 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on July 8, 2015 20:23


I'd recommend to implement your custom tab control in this case.

The other option is to copy ~/CMSWebParts/Layouts/Tabs.ascx.cs and try to modify it, so it will meet your requirements.

0 votesVote for this answer Mark as a Correct answer

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