Site tree returns a tree-like structure (branch instances) with subpages of given page/node. The service is registered in the container as kunstmaan_extra.site_tree and is available as a get_page_children twig helper.
There are following options you can pass to modify behaviour:
depth(default: 1) — limit the resuts to this many levelsrefName— an array of class names. for instance: only fetchinclude_root(false) — by default the result doesn’t return the parent node, only the childreninclude_hidden(false) - add nodes with the ”hide from menu” option selectedinclude_offline(false) - include unpublishedlimit(no limit) — return not more than limit results
Twig helper has a litte different interface. Since it’s harder to use class names in twig templates, the refName option is exposed as a second parameter and instead of class names it expects friendly names (converted to class names using Content Type).
{% set articles = get_page_children(page, 'article', {"limit": 3}) }Use the kunstmaan_extra.site_tree.current_locale service for conviniently getting the locale of the current request
with a fallback for the site’s default locale.
Navigation component provides a simple prev/next page via two twig functions:
get_navigation_next(page)get_navigation_prev(page)
Those functions return a Branch instance and return only siblings of the same type as a given page.