---
title: Writing page path expressions
related:
  - https://docs.kentico.com/k11/developing-websites/loading-and-displaying-data-on-websites/loading-page-data.md
  - https://docs.kentico.com/k11/configuring-kentico/configuring-page-urls/setting-page-aliases.md
  - https://docs.kentico.com/k11/configuring-kentico/configuring-page-urls.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

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](https://docs.kentico.com/k11/configuring-kentico/configuring-page-urls/setting-page-aliases.md) values of pages. You can use two types of path values:

- Exact paths of individual pages
- Expressions containing special characters that specify multiple pages or relative paths

You need to use path expressions in the **Path** property of [web parts](https://docs.kentico.com/k11/developing-websites/developing-websites-using-the-portal-engine/using-and-configuring-web-parts.md) or controls that load data from pages (page data sources, page listings with built-in data sources, [navigation components](https://docs.kentico.com/k11/developing-websites/loading-and-displaying-data-on-websites/building-website-navigation.md)).

## Using wildcard characters (% and \_)

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:

- **/** - only the root page
- **/%** - all pages
- **/Products** - only the _Products_ page
- **/Products/%** - all child pages under the _Products_ page

The \_ **wildcard represents a single character**. For example:

- **/Product\_** - selects pages _/ProductA_, _/Product1_, _Product2_ etc.

> **Tip:** **Escaping wildcards in paths**
>
> If you need to use the wildcards as standard characters inside path expressions, enclose the character inside brackets (\[ ]). For example:
>
> - **/Special\[\_]Offers -** selects the _Special\_Offers_ page

## Using relative paths

You can use relative paths expressions to **select child pages or parent pages**.

Examples:

- **.** - the current page's path
- **..** - the path of the current page's parent
- **./Product** - page _Product_ under the current path
- **../Product** - page _Product_ under the parent page of the current path
- **./%** - all pages under the current path (or selection of the current page, see _Leaving the Path value empty_ below)
- **../%** - all pages under the parent page of the current path

## Leaving the Path value empty

If you leave the path value empty, the behavior depends on the type of the component and other variables.

#### Navigation components

For [navigation components](https://docs.kentico.com/k11/developing-websites/loading-and-displaying-data-on-websites/building-website-navigation.md) (such as the **CSS list menu** web part), an empty value always sets the path to all pages (equivalent of /%).

#### Standard page data sources

General web parts and controls with page data sources perform one of the following actions if you leave the Path property empty:

- **Selection of the current page** - the component loads and displays only the current page using the _Selected item_ [transformation](https://docs.kentico.com/k11/developing-websites/loading-and-displaying-data-on-websites/writing-transformations.md) (if specified).
- **Loading of child pages** - equivalent of _/%_. All [filtering options](https://docs.kentico.com/k11/developing-websites/loading-and-displaying-data-on-websites/loading-page-data.md) specified for the data source still apply.

The behavior depends on the following conditions:

\* Whether the listing component's **Page types (ClassNames)** property includes the current page's [page type](https://docs.kentico.com/k11/developing-websites/defining-website-content-structure/page-types.md). **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 |

> **Note:** For standard page data sources, the **./%** path expression works exactly the same way as an empty path value.

## Getting parts of the current path

You can use special expressions to **extract parts of the current page's path**.

- {0} - the alias of the page on the first level of the current path
- {1} - the page alias of the current path's second level
- ...

For example, if the page path is: _**/Company/Careers/USA-Branch/Development/QA-Engineer**_

- **{0}** = Company
- **{1}** = Careers
- **{3}** = Development

Path examples:

- **/{0}/{1}/%** - all pages under the second level of the current path
- **/{0}/{1}/Details** - page _Details_ on the third level of the current path

> **Note:** **Note**: If you attempt to extract a level that does not exist in the current page's path:
>
> - The expression returns an empty value.
> - If there is a slash (/) after the expression, the system removes it when resolving the overall path.
