Linking to other pages

You can create links to other pages using the $link placeholder:

Linking to a page

<a href="$"pageTitle")">Link_to_page</a>

You can also link to a page in a specific space:

Linking to a page in another space

<a href="$"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 = $"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.

Chapter navigation

#if( $ )
    <a href="$">$</a> 
#if( $page.prev )
    <a href="$page.prev.absoluteLink">$page.prev.title</a>

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> 

More resources

The Add breadcrumbs uses $page.ancestors. More information can be found in the PagePlaceholder docs.