Kentico CMS 7.0 Controls

Configuration

Configuration

Previous topic Next topic Mail us feedback on this topic!  

Configuration

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

As it is inherited from the BasicUniView control, which is in turn derived from the UniView control, the CMSUniView control has all of their properties. These can be found in the BasicUniView -> Configuration and UniView -> Configuration topics.

 

In addition, it has all of the following properties that can be set or used in the API:

 

CMS controls - common properties

Displaying related documents

 

As well as:

 

Property Name

Description

Sample Value

DataSourceControl

Object of the data source control.

 

DataSourceName

ID of the data source control.

 

DelayedLoading

Indicates whether data should be loaded during the load event instead of the default init event.

 

EnablePaging

Indicates whether the built-in UniPager control should be used to for paging. If you wish to use paging, please be sure to set LoadHierarchicalData to false, as hierarchical data cannot be paged.

 

ItemSeparatorValue

Separator that will be rendered between the displayed items.

 

This property has greater priority than the separator set in the transformation given in the SeparatorTransformationName property.

"<hr/>"

LoadHierarchicalData

Indicates whether data should be bound in the default format (flat structure) or changed to a hierarchical grouped dataset.

 

NestedControlsID

IDs of nested controls (CMSRepeater, CMSDataList...), separated by semicolons.

"CMSRepeaterNested;CMSDataListNested"

PageSize

The number of displayed items per page.

 

PagerControl

Gets the current UniPager control used for paging.

 

PagerPosition

The position of the pager relative to the paged data.

"Bottom"

"Top"

"TopAndBottom"

ShowEditDeleteButtons

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

 

UseHierarchicalOrder

Indicates whether the default hierarchical order value should be used. The order is used only if LoadHierarchicalData is set to true. The default order value is "NodeLevel, NodeOrder". The value of the OrderBy property is added to the end of the OrderBy expression.


 

Specifying transformations

 

The following properties can be filled to define which transformations should be used by the control. All transformations are specified in format:

 
<document type code name>.<transformation name>

 

The design of the listed items can alternatively be set by defining the ItemTemplate elements inherited from the UniView control between the tags of the CMSUniView control.

 

Property Name

Description

Sample Value

AlternatingTransformationName

Name of the transformation applied to items that have an even position in the listing order. Every level in the hierarchy has its own separate alternation pattern.

 

FirstTransformationName

Name of the transformation applied to the first item on every level in the hierarchy. Only works for levels that contain more than one item.

 

FooterTransformationName

Name of the transformation rendered at the end of every level (after the last item on the level). Can be used to close encapsulating elements from the Header.

 

HeaderTransformationName

Name of the transformation rendered at the beginning of every level (before the first item on the level). Provides a convenient way to visually separate or style individual levels.

 

HierarchicalTransformationName

Name of the used hierarchical transformation.

 

Please see the Using hierarchical transformations topic for an example of how this property can be used.

 

LastTransformationName

Name of the transformation applied to the last item on every level in the hierarchy. Only works for levels that contain more than one item.

 

SelectedFooterItemTransformationName

Name of the transformation used for the footer of selected items.

 

SelectedHeaderItemTransformationName

Name of the transformation used for the header of selected items.

 

SelectedItemTransformationName

Name of the transformation applied to the currently selected item (i.e. the document that is being viewed).

 

SeparatorTransformationName

Name of the transformation rendered between items.

 

If hierarchical data is loaded, the separator is placed only between items on the same level (i.e. not between a parent item and its child).

 

SingleTransformationName

Name of the transformation applied in cases where there is only one item on a level in the hierarchy.

 

TransformationName

Name of the transformation applied to all displayed items that are not covered by a specialized transformation type (e.g. alternating items, first items etc.).

 

 

Configuring the pager

 

The CMSUniView control has a built-in UniPager control which can be enabled by the EnablePaging property. The following templates can be defined within the tags of the CMSUniView control to determine the design of the pager. Please refer to the UniPager -> Structure  topic to see what individual templates represent.

 

Template Name

Description

Sample Value

PagerCurrentPageTemplate

Code of the template used for the current page in the pager. Use <%# Eval("Page") %> to get the current page number, <%# Eval("PageURL") %> to get page the URL or <%# Eval("PageLink") %> to get the page link.

<strong><%# Eval("Page") %></strong>

PagerDirectPageTemplate

Code of the template used for direct page changing. Use a TextBox or DropDownList control with ID directPageControl to register the page change event.

Page

<asp:TextBox ID="DirectPageControl" runat="server" Style="width: 25px;" />

of

<%# Eval("Pages") %>

PagerFirstPageTemplate

Code of the template used for the link to the first page in the pager. Use <%# Eval("FirstURL") %> to get the link to the first page.

<a href="<%# Eval("FirstURL") %>">|&lt;</a>

PagerLastPageTemplate

Code of the template used for the link to the last page in the pager. Use <%# Eval("LastURL") %> to get the link to the last page.

<a href="<%# Eval("LastURL") %>">&gt;|</a>

PagerLayoutTemplate

Code of the template used for the overall pager layout.

 

PagerNextGroupTemplate

Code of the template used for the link to the next group of pages. Use <%# Eval("NextGroupURL") %> to get the link to the next group.

<a href="<%# Eval("NextGroupURL") %>">...</a>

PagerNextPageTemplate

Code of the template used for the link to the next page. Use <%# Eval("NextURL") %> to get the link to the next page.

<a href="<%# Eval("NextURL") %>">&gt;</a>

PagerPageNumbersSeparatorTemplate

Code of the template used for the separator between page links in the pager.

&nbsp;

PagerPageNumbersTemplate

Code of the template used for page links in the pager. Use <%# Eval("Page") %> to get the current page number, <%# Eval("PageURL") %> to get the URL of the current page or <%# Eval("PageLink") %> to get the page link.

<a href="<%# Eval("PageURL") %>"><%# Eval("Page") %></a>

PagerPreviousGroupTemplate

Code of the template used for the link to the previous group of pages. Use <%# Eval("PreviousGroupURL") %> to get the link to the next group.

<a href="<%# Eval("PreviousGroupURL") %>">...</a>

PagerPreviousPageTemplate

Code of the template used for the link to the previous page. Use <%# Eval("PreviousURL") %> to get the link to the next page.

<a href="<%# Eval("PreviousURL") %>">&lt;</a>