I wished to make Prev/Next links in the staticpage navigation to not show when no previous or Next page is available. (till now links to the current page are shown as previous or next links). The modification is in serendipity_event_staticpage.php, function getNavigationData(), just after assigning the $nav array and before return $nav:
Code: Select all
$nav = array(
'prev' => array(
'name' => $this->get_config('showtextorheadline') ? STATICPAGE_PREV : $pages[$i-1]['pagetitle'],
'link' => $pages[$i-1]['permalink']
),
'next' => array(
'name' => $this->get_config('showtextorheadline') ? STATICPAGE_NEXT : $pages[$i+1]['pagetitle'],
'link' => $pages[$i+1]['permalink']
),
'top' => array(
'name' => (($top['id'] == $pages[$i-1]['id']) || ($this->get_config('showtextorheadline'))) ? STATICPAGE_TOP : $top['name'],
'link' => ($top['id'] == $page[$i-1]['id'] ? $serendipity['serendipityHTTPPath'] : $top['permalink'])
)
);
/*
remove link names when links are empty => as a result 'Prev' and/or 'Next'
do not show when no previous and/or next static pages are present
*/
if ($this->get_config('showtextorheadline')) {
if ($nav['prev']['link'] == '') {
$nav['prev']['name'] = '';
}
if ($nav['next']['link'] == '') {
$nav['next']['name'] = '';
}
if ($nav['top']['link'] == '') {
$nav['top']['name'] = '';
}
}
return $nav;