Kentico CMS 6.0 Developer's Guide

Creating web part containers

Creating web part containers

Previous topic Next topic Mail us feedback on this topic!  

Creating web part containers

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

Here's an example of defining a new web part container:

 

1. Go to Site Manager -> Development -> Web part containers.
 

2. Click NewContainer New container.
 

3. Enter the following values:

 

Display name: Blue box

Code name: BlueBox

HTML before web part:

 

<table width="100%" class="BlueTable" cellpadding="5" cellspacing="0">

<tr valign="top">

<td class="BlueTitle">

{%ContainerTitle%}

</td>

</tr>

<tr valign="top">

<td>

 

HTML after web part:

 

</td>

</tr>

</table>

 

4. Click the Add CSS styles link and define the used CSS classes in the newly displayed field:

         

.BlueTable

{

  border: 1px solid #4a62e4;

}

 

.BlueTitle

{

  background-color:#4a62e4;

  font-weight:bold;

  color:white

}  

 

5. Click OK to create the new container.
 

6. Switch to the Sites tab and click the Add sites button to assign the new container to the website where you wish to use it.

 

7. Go to CMS Desk and display some page on the Design tab. Configure (Configure) some web part and set its properties like this:

 

Use container: Blue box

Container title: My web part with container
 

8. View the page in Live site mode. The web part will be surrounded by a blue border and it will have the specified title.