Containers overview

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

Containers are used as "boxes" for web parts. They consist of content that is displayed before and after the web part which means they are used as an envelope for web part content. They have three advantages over using the ContentBefore and ContentAfter properties:

 

1. They are re-usable for many web parts.

2. They can contain a title and dynamically inserted values of the web part properties.

3. They are objects in the system, which means they can be Exported and Imported.

 

Containers can be assigned not only to web parts, but also widgets and entire web part zones.

 

The containers can be managed at Site Manager -> Development -> Web part containers. The following properties can be defined when editing (Edit) or creating a web part container:

 

Display name

The name of the container displayed to the users.

Code name

The name of the container used in code.

Text before web part

HTML content displayed before the web part - the beginning of the envelope.

Text after web part

HTML content displayed after the web part - the closing part of the envelope.

 

The Text before/after web part fields can contain dynamically inserted values of the web part properties. You can insert them using the following expression:

 

{%propertyname%}

 

You will most often use the following expression to insert the container title:

 

{%ContainerTitle%}

 

These macro expressions are resolved even when macro resolving for the particular web part (Disable macros property) is disabled.

 

Containers are assigned to web parts, widgets or zones simply by configuring (Configure) them and selecting a container through the Web part container property.

 

devguide_clip1262

 

Here's an example of a web part without a container:

 

devguide_clip0381

 

Here's an example of the same web part with a container:

 

devguide_clip0382

 

Please see the Creating web part containers topic for a step-by-step guide on how a new container is created.

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?web_part_containers_overview.htm