Kentico CMS 6.0 Controls

Path specification in controls and web parts

Path specification in controls and web parts

Previous topic Next topic Mail us feedback on this topic!  

Path specification in controls and web parts

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

Many web parts and controls use a Path property that allows you to specify which documents should be displayed. This is the AliasPath property of the document. You can use either an exact path or utilize special characters for specifying multiple selection or relative paths:

 

Using wildcard characters % and _

 

You can use % as a wildcard character for any number of characters, which allows you to select all documents under the specified site section.

 

Examples:

 

/ - only root

/% - all documents

 

/Products - only the Products document.

/Products/% - all documents under the Products document.

 

You can also use the _ character (underscore) as a wildcard character for a single character.

 

Examples:

 

/Product_ - selects documents /ProductA, /Product1, etc.

 

Leaving the Path value empty

 

In many cases, the Path value can be left empty.

 

For navigation controls/web parts, such as CMSMenu/Drop‑down menu, this causes the path to be set to all documents - /%.

 

In the case of listing controls/web parts, such as CMSRepeater/Repeater or CMSDataGrid/Grid, the path is set to display all child documents of the page containing the control or web part - <current alias path>/%.

 

Using a formatting string to get parts of the path

 

You can also use special expressions that extract parts of the current path, such as this.

 

Examples:

 

/{0}/{1}/% - all documents under the second document level of the current path

/{0}/{1}/Details - document Details under the second document level of the current path

 

Using relative paths

 

You can use relative path expressions to specify sub-documents or parent documents:

 

Examples:

 

./Product - document Product under the current path

../Product - document Product under the parent document of the current path

. - current path

.. - parent document of the current path

./% - all documents under the current path

../% - all documents under the parent document of the current path