Custom Navigation Per Page
See Also
- UserMenus - Menus defined by a suffix added to the page tag.
Last edited by
DanWest:
Modified links pointing to docs server
What
- Custom Navigation Links per page
- I know it's been done before This is a new twist
- Controled by a single NavigationLinks page.
Use
- You define a page 'NavigationLinks'.
- In that page you list each target page tag on a line delimited by : (colons) followed by the custom links.
Example NavigationLinks page
:SomePage: [[HomePage Home]] [[PersonalPage My Page]] [[UserSettings User Settings]]
:AnotherPage: [[HomePage Home]] [[PersonalPage My Page]] [[SomePage Some Other Page]] [[UserSettings User Settings]]
Installation
- Requires a small change to the header.php action.
Code
File:
header.php
$nav_page = $this->LoadPage('NavigationLinks');
if(ereg(':' .
$this->
page['tag'] .
': ([^\n]*)\n',
$nav_page['body'],
$match)) {
echo $this->
Format($match[1]));
} else if ($this->GetUser()) {
echo $this->
config['logged_in_navigation_links'] ?
$this->
Format($this->
config['logged_in_navigation_links']).
'' :
'';
} else {
echo $this->
config['navigation_links'] ?
$this->
Format($this->
config['navigation_links']) :
'';
}
To Do
- More testing. I'm sure there are some bugs or things I'm not checking.
- Get to bed, it's 1:40 in the morning...
CategoryUserContributions