Linking to other pages
You can create links to other pages using the $link placeholder:
<a href="$link.page("pageTitle")">Link_to_page</a>
You can also link to a page in a specific space:
<a href="$link.page("spaceKey", "pageTitle")">Link_to_page_in_other_space</a>
During rendering, Scroll Viewport replaces the placeholder with a generated link. For more information, see the complete reference of the $link placeholder .
Retrieving content from other pages
Sometimes you have to fetch some information from other pages, such as children or the next or previous page.
Other page objects
This will retrieve a page with all the methods and properties a usual PagePlaceholder has.
#set($otherPage = $include.page("Other Page"))
You can also add the space to this function in the same way as with the $link placeholder.
Related page objects
You can also retrieve a page's children pages, parent page and next and previous pages.
#if( $page.next )
<a href="$page.next.absoluteLink">$page.next.title</a>
#end
#if( $page.prev )
<a href="$page.prev.absoluteLink">$page.prev.title</a>
#end
If you want to retrieve only pages at the same level, you can use the following snippet:
#if ($page.parent.children.contains($page.prev) && $page.prev)
<a href="$page.prev.absoluteLink">$page.prev.title</a>
#end
More resources
The Add breadcrumbs uses $page.ancestors. More information can be found in the PagePlaceholder docs.