Kentico CMS 7.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!  

CMS controls (and web parts) that display document data or navigation elements use a Path property to select a set of documents from the content tree.

 

The Path property accepts path expressions based on the alias path values of documents. You can use either the exact paths of individual documents or expressions containing special characters, which specify multiple documents 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 the root document

/% - all documents

 

/Products - only the Products document.

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

 

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

 

Examples:

 

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

 

Leaving the Path value empty

 

In many cases, you can leave the Path value empty.

 

For navigation controls/web parts (such as CMSMenu/Drop‑down menu), an empty value sets the path to all documents: /%

 

Listing controls/web parts with document data sources (such as CMSRepeater/Repeater) evaluate empty path values dynamically based on the document type of the current document:

 

If the type matches the value of the control or web part's ClassNames (Document types) property, the empty path automatically selects the current document.

If the document type does not match, the path is set to all child documents: <current alias path>/%

 

Using formatting strings to get parts of the path

 

You can also use special expressions that extract parts of the current path.

 

Examples:

 

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

/{0}/{1}/Details - document Details on 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:

 

. - current path

.. - parent document of the current path

./Product - document Product under the current path

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

./% - all documents under the current path

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