Add a new field to any of your content files to which you'd like to add related pages:
You are free to name the field that contains the related pages however you like, as long as you take care of using the right variable in the template later.
Add any number of related pages with the YAML syntax. To link pages, store their URI (the URL without your domain) in the content file. Since the URI is unique, Kirby will always be able to find the right page, even if you change its content or its sorting number. You have to be careful, however, if you change the location of a page or its folder name.
If you don't want to add and edit the entries manually in the content file, make sure to set up the Panel accordingly.
Accessing those related posts in your templates could look like this:
We use the
query option to display all sibling pages of the current page in the list. By passing
false to the
$page->siblings() method, we exclude the current page from the list – we don't want the article itself to be a related article. Learn more about our query syntax.