Sorry, this page is only available in one language

PreviousPage2

Suggested dropletname: PreviousPage

Published by: Dev4me

The PreviousPage2 Droplet will create a link to the previous page.
(works over all menu levels)

$page_id = PAGE_ID;
$r = " ";
if ($page_id !== 0) {
    ob_start();     
    show_menu2(0,SM2_ROOT,SM2_ALL,SM2_ALL,',[url]','','','','','');
    $allpages = explode(',', ob_get_contents());
    ob_end_clean();
    ob_start(); 
    show_menu2(0,SM2_ROOT,SM2_ALL,SM2_ALL,',[page_id]','','','','','');
    $allpageids = explode(',', ob_get_contents());
    ob_end_clean();
    $pos = array_search($page_id, $allpageids);
    if ($pos > 1) {
            $prev= $allpages[$pos - 1]; 
    } else {
        $prev = $allpages[count($allpages)-1]; 
    }
           $r = '<a title="Go to the previous page" href="'.$prev.'"><<</a>';
}
return $r;

The difference with the original previouspage Droplet is that this one will create a link to the previous page on all levels.

You can use this to let the viewer browse through all (visible) pages on your site.



« Previous droplet | Overview | Next droplet »