Page Navigation
If you need to show links on a page to the previous and next sibling pages, you can use the following code in a component named e.g. pagenav:
<?php $slug = (string) return_page_slug(); $bc = return_i18n_breadcrumbs($slug); $level = count($bc) - 1; $nav = return_i18n_menu_data($slug,$level,$level,I18N_SHOW_PAGES); $i = 0; while ($i < count($nav) && $nav[$i]['url'] != $slug) $i++; if ($i > 0) { echo '<a href="'.find_i18n_url($nav[$i-1]['url'],$nav[$i-1]['parent']). '"><< '.$nav[$i-1]['title'].'</a> '; } if ($i+1 < count($nav)) { echo '<a href="'.find_i18n_url($nav[$i+1]['url'],$nav[$i+1]['parent']). '">'.$nav[$i+1]['title'].' >></a>'; } ?>
Because of I18N_SHOW_PAGES it does not matter, if the pages are in the menu or not. You could also show the menu text with $nav[...]['menu'] or show previous and next links in separate components.
You can then include this component in your page using the DynPages plugin with
{% pagenav %}
or in your template using
<?php get_i18n_component('pagenav'); ?>
Here is an example of a page navigation:
<< Display child pages Multiple independent menus >>