I am currently building a couple of Q&A sites, one of which will feature a StackOverflow-style top bar and main nav.
For this site I am pulling the administration link entirely out of the main navigation menu, and also moving the custom page links from the main nav to the user nav. I do this by finding, copying and unsetting the navigation menus with code like this:
// extract and remove the admin menu link
if(isset($this->content['navigation']['main'])) {
$this->admin_link = $this->content['navigation']['main']['admin'];
unset($this->content['navigation']['main']['admin']);
}
// move all the 'opposite' links from the main nav to the user nav
foreach($this->content['navigation']['main'] as $k => $v) {
if(isset($v['opposite']) && ($v['opposite']===true)) {
$v['opposite'] = false;
$this->content['navigation']['user'][$k] = $v;
unset($this->content['navigation']['main'][$k]);
}
}
Is there a neater or more 'official' way to achieve this within a theme or otherwise?