You can do advanced filtering toward the twig pages_list like in the admin-block-editor.
| Value | Expected behavior |
|---|---|
children | filter children pages (case insensitive) |
grandchildren | filter grandchildren pages's pages (case insensitive) |
children_children | alias for grandchildren (deprecated) |
sisters | filter sister pages (case insensitive) |
parent_children | alias for sisters (deprecated) |
related | if there is a parent page, filter results with sister pages with a pageId inferior to currentPageId + 3 |
comment:exampleValue | filter pages containing in mainContent <!--exampleValue--> (deprecated, prefer tags) |
related:comment:exampleValue | same as related but instead of sister pages, it's pages containing the comment |
title:exampleValue | filter pages containing in title (seo title or h1) the exampleValue |
content:exampleValue | same than title + searching in mainContent too |
slug:exampleValue | filter pages with the exact slug (useful only with OR) |
slug:%exampleValue% | same than slug: with % ➜ filter page with the slug containing exampleValue. |
| exampleValue | filter tag (exact match only !) |
OR or ANDFor now, you can only use OR or AND operator in the same query
Examples :
related:comment:blog OR relatedparent_children OR related OR page:custom-slugparent_children AND related AND page:custom-slug (this one will output only 1 result)parent_children AND related OR page:custom-slug (this one will output only 1 result)(parent_children AND related) OR page:custom-slug (this one will output only 1 result)When your page content contains links to other pages, you can exclude those pages from your listings to avoid duplicates. Add the excludeAlreadyLinked: true parameter:
{{ pages_list('taxonomy:travel', 6, excludeAlreadyLinked: true) }}
Or use the exclude_linked() function with pages():
{% set uniquePages = exclude_linked(pages(host, 'taxonomy:travel')) %}
See the Link Collector documentation for detailed usage, examples, and the full API reference.