Common web part properties

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

Many web parts use the same or similar properties. The following table summarizes the most important properties found in most web parts:

 

Default properties

 

Property Name

Description

Sample Value

Web part control ID

Unique identifier of the web part.

text1

 

Visibility

 

Property Name

Description

Sample Value

Visible

Indicates if the web part is visible.


Hide on sub-pages

Indicates if the web part should be hidden on sub-pages. If you check this box, the web part will be displayed only on the page that uses the page template with this web part and it will be hidden on sub-pages that inherit the page template.


Show for document types

Indicates for which document types the web part should be displayed. If the type of the currently selected document is different, the web part will not be displayed.

cms.news;cms.event

Display to roles

List of roles whose members should see the web part. If no role is specified, the web part zone is displayed to all users.

cmseditors;customrole

 

Web part container

 

Property Name

Description

Sample Value

Web part container

Container (box) displayed around the web part. The containers can be defined in Site Manager -> Development -> Web part containers.


Container title

Container title displayed in the web part container if one is specified. Displayed only if the {%ContainerTitle%} macro is used in the code of the container.

Latest news

Container CSS class

CSS class used for the web part container. Applied only if the {%ContainerCSSClass%} macro is used as a value of the Class attribute in the code of the container.


Container custom content

Custom content of the web part container; applied only if the {%ContainerCustomContent%} macro is used in the code of the container.


 

HTML Envelope

 

Property Name

Description

Sample Value

Content before

HTML content to be displayed before the web part. Can be used to display a header or add some encapsulating code such as <div> or <table> elements for the required layout.

<table style="background-color: red"><tr><td>

Content after

HTML content to be displayed after the web part. Can be used to display a footer or close the tags contained in the ContentBefore value, such as </div> or </table> elements.

</td></tr></table>

 

The structure of a web part and its envelope looks like this:

 

devguide_clip1110

 

You can find more details on web part containers in the Containers overview topic.

 

Content

 

Property Name

Description

Sample Value

Path

Path of the documents to be displayed. See Appendix B - Path expressions for details.

/news/%

Highlighted node path

Alias path of the node that should be selected in a menu control. If you do not specify any value, the current path is used.

/products/nokia

Query

Name of the query to be used for retrieving data from the Kentico CMS Database. The queries can be defined in Site Manager -> Document types -> edit some document type -> Queries.

cms.news.selectlatest

 

Content filter

 

Property Name

Description

Sample Value

Document types

Types of documents that should be displayed, separated by a semicolon (;).

 

In the case of menu and navigation web parts, page (cms.menuitem) documents are selected by default.

 

The other web parts retrieve all documents without their custom fields by default.

 

Please note: if you specify more than one document type, only common data fields from the View_CMS_Tree_Joined view will be available in the web part (in transformations, WHERE condition and ORDER BY expressions).

cms.article;cms.news;cms.menuitem

Combine with default culture

Indicates if the default language version of the document should be displayed if the document is not translated to the current language.

You can choose between Yes and No or you can use website-level settings.

Culture code

Culture of the content to be displayed.

en-us

Maximum nesting level

Maximum nesting level. It specifies the number of sub-levels in the content tree that should be included in the displayed content.

 

The value 1 indicates that only the current document should be returned.

The value -1 indicates all child documents.


ORDER BY expression

ORDER BY part of the SELECT query.

ProductName ASC, ProductPrice DESC

Select only published

Indicates if only published documents should be displayed.


Site name

Code name of the website from which you want to display the content.

 

If you leave the value empty, the content is retrieved from the current website.

CorporateSite

WHERE condition

WHERE part of the SELECT query.

ProductPrice > 100 AND ProductColor='green'

Filter out duplicate documents

If the displayed data contains multiple links to the same document (see Linked docs for details), you can choose to display only one of them.


 

System settings

 

Property Name

Description

Sample Value

Check permissions

Indicates if the permissions of the current user should be checked for the content displayed by the web part. If enabled, only documents for which the user has the read permission will be displayed.


Cache item name

Sets the name of the cache key used for the content displayed by the web part. If not specified, this name is generated automatically based on the site, document path, Web part control ID and current user.

 

A cache key can be shared between multiple web parts displaying the same content on different pages in order to avoid keeping redundant data in the memory.

latestnewslist

Cache minutes

Sets the number of minutes for which the content displayed by the web part should remain cached before its latest version is reloaded from the database.

 

If left empty, the value entered into the Site Manager -> Web site -> Cache content (minutes) setting will be used instead.

 

If set to 0, caching will be disabled for the web part.

10

Cache dependencies

Contains a list of cache keys on which the content cache of the web part depends. When the specified cache items change, the content cache of the web part is deleted. Each line may only contain a single item.

 

If the Use default cache dependencies box is checked, the default dependencies will be used, which include all possible object changes that could affect the content of the specific web part.


 

Design

 

Property Name

Description

Sample Value

CSS prefix

Prefix used for CSS class names. This property allows you to set up different CSS styles for particular menu levels. Every level of the menu will use the prefix for CSS class names that you specify.

Main;Sub1;Sub2

Highlight all items in path

Indicates if all items in the currently selected path of the menu control should be displayed as highlighted.


Submenu indicator

Path to the image that should be displayed next to items that have sub-items.

/images/submenu.gif

Use alternating styles

Indicates if odd and even items should have different styles.


 

Paging

 

Property Name

Description

Sample Value

Enable paging

Indicates if displayed data should be paged.


Paging mode

Type of paging parameter - it can be passed either through the URL (Query string) or through postback (Postback).


Pager position

Position of the pager - top or bottom


Page size

Number of records per page.

10

Query string key

The name of the URL parameter that will contain the current page number.

mylistpage

Show first and last buttons

Indicates the buttons that link to the first and last page should be displayed.


 

Relationships

 

These settings allow you to configure the web part so that it displays only content that is related to the specified (main) document.

 

Property Name

Description

Sample Value

Main document

Document for which you want to display related documents.


Relationship  name

Name of the relationship between documents.

Is related to

Main document is on the left side

Indicates if the main document is on the left side of the relationship.


 

No data behavior

 

Property Name

Description

Sample Value

Hide if no record found

Indicates if the web part should be hidden when no record is found.


No record found text

Text that should be displayed if no data is found.

No data found.

 

Editing buttons

 

Property Name

Description

Sample Value

Show New button

Indicates if the button for adding new items should be displayed in the Edit mode when viewing the page.


New button text

New button description text.

Add new news.

Show edit and delete buttons

Indicates if edit and delete buttons should be automatically shown for each displayed item in the Edit mode.


 

Transformations

 

Property Name

Description

Sample Value

Alternating transformation

Transformation used for even items in list view mode in format <class prefix>.<document type>.<transformation name>.

cms.news.preview_alternating

Transformation

Transformation used for items in list view mode in format <class prefix>.<document type>.<transformation name>.

cms.news.preview

Selected item transformation

Transformation used for items in detail view mode in format <class prefix>.<document type>.<transformation name>.

cms.news.default

Item separator

Item separator displayed between records.

<hr/>

 

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