Path expressions allow you to select a set of pages from the content tree of Kentico websites. The expressions are based on the alias path values of pages. You can use two types of path values:
You need to use path expressions in the Path property of web parts or controls that load data from pages (page data sources, page listings with built-in data sources, navigation components).
The % wildcard represents any number of characters.Add the wildcard to the end of the path to select all pages under the specified section of the site.
Examples:
The _ wildcard represents a single character. For example:
Escaping wildcards in paths
If you need to use the wildcards as standard characters inside path expressions, enclose the character inside brackets ([ ]). For example:
You can use relative paths expressions to select child pages or parent pages.
Examples:
If you leave the path value empty, the behavior depends on the type of the component and other variables.
For navigation components (such as the CSS list menu web part), an empty value always sets the path to all pages (equivalent of /%).
General web parts and controls with page data sources perform one of the following actions if you leave the Path property empty:
The behavior depends on the following conditions:
* Whether the listing component's Page types (ClassNames) property includes the current page's page type. Note: An empty value includes all page types.
** If the current page type has the Behaves as Page (menu item) type flag enabled (Page types -> Edit the page type -> General).
Page type match (*) | Behaves as Page (menu item) type flag (**) | Empty path behavior |
|---|---|---|
Selection of the current page | ||
Loading of child pages | ||
Loading of child pages | ||
The data source does not load any data at all |
For standard page data sources, the ./% path expression works exactly the same way as an empty path value.
You can use special expressions to extract parts of the current page's path.
For example, if the page path is: /Company/Careers/USA-Branch/Development/QA-Engineer
Path examples:
Note: If you attempt to extract a level that does not exist in the current page's path: