Linking to other pages

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

Linking to a page

<a href="$link.page("pageTitle")">Link_to_page</a>
HTML/XML

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

Linking to a page in another space

<a href="$link.page("spaceKey", "pageTitle")">Link_to_page_in_other_space</a>
HTML/XML

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"))
PHP

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( $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
XML

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
CODE

More resources

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