Kentico CMS 7.0 Controls

Using control properties to set query clauses

Using control properties to set query clauses

Previous topic Next topic Mail us feedback on this topic!  

Using control properties to set query clauses

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

Listing web parts and controls provide properties that set sections of the query (clauses) that loads the data. These properties allow users to adjust the data retrieval for individual instances of web parts or controls. To maintain this functionality for your custom queries, add the following expressions into the query code:

 

Property

Expression

OrderBy

##ORDERBY##

SelectedColumns

##COLUMNS##

TopN

##TOPN##

WhereCondition

##WHERE##

 

For example, a query that selects page (menu item) documents looks like this:

 

SELECT ##TOPN## ##COLUMNS## FROM View_CONTENT_MenuItem_Joined WHERE (##WHERE##) ORDER BY ##ORDERBY##

 

Dynamic insertion of WhereCondition parameters

 

The controls in this section also support dynamically inserted parameters into the WhereCondition property:

 

You can use context macro expressions that are resolved at run-time, such as the following:

 

Expression

Description

{%currentaliaspath%}

Alias path of the current page.

{%currentculturecode%}

Culture code of the user's preferred content culture.

{%currentsiteid%}

SiteID value of the current site.