Kentico CMS 7.0 Tutorial  

Web part modifications

Web part modifications

Previous topic Next topic Mail us feedback on this topic!  

Web part modifications

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Web part cloning

 

If you need to copy or modify the behavior of some web part, you can clone the web part. It ensures that your changes won't be overwritten with the nearest upgrade.

 

You can clone a web part in Site Manager -> Development -> Web parts. Choose the original web part and click CloneReport Clone web part. Then, you can modify the web part's code in Visual Studio.

 

Web part layout

 

Custom web part layouts allow you to modify the design of web parts. It's useful if you need to change the appearance of a dialog or hide a field.

 

Go to CMS Desk, choose the Design tab, open the web part's properties dialog and switch to the Layout tab. Here you can choose to create a new layout and modify its HTML code. Please note: you always need to keep all ASP.NET controls in the layout. If you need to hide some of the controls, just add the Visible="False" attribute to the control.

 

Web part inheritance

 

Web part inheritance allows you to create web parts with pre-set values for a particular purpose. You can, for example, create a specialized web part for displaying news, inherited from the Repeater web part. You must define default values for the relevant properties so that the Repeater web part displays news items without additional configuration. It may speed up your work.

 

You can create an inherited web part by going to Site Manager -> Development -> Web parts, clicking NewWebPart New web part and choosing to inherit from an existing web part.