Adding links in the AutoNav template

Permalink
I know changing core blocks is a bad thing but I wanted to test before creating a new block.

I am trying to display custom links that always appear on the header menu. To do this, I added a small block of code to the header_menu.php template in autoNav. I added this after the main loop and before the closing </ul> statement.

Here is the code I added...
$u = new User();
         if($u->isLoggedIn() && !$c->isEditMode()) { 
            echo('<li><a href="/index.php/login/logout/">Logout</a></li>');
            echo('<li><a href="/index.php/profile/">Profile</a></li>');
         }elseif(!$u->isLoggedIn()){
            echo('<li><a href="/index.php/login/">Login</a></li>');
         }


This works perfectly on my test server but when I try to use it on a server that has advanced permissions turned on it doesn't work, in fact it acts like the code is not even there.

I'm sure I need something extra to make this happen in the advanced model but I don't know what I'm missing.

Can anyone help? This is giving me a headache :-)

Thanks,
Frank

fmatlock
 
Remo replied on at Permalink Reply
Remo
Are you sure this is because of the advanced permission mode? Did you try to disable it?
Mnkras replied on at Permalink Reply
Mnkras
if you used advanced permssions and turn it off it could cause more problems, and here is an improvement of the code:
$u = new User();
         if($u->isLoggedIn()){ 
            echo('<li><a href="' . $this->url('/login/logout') . '">Logout</a></li>');
            echo('<li><a href="' . $this->url('/profile') . '">Profile</a></li>');
         }else{
            echo('<li><a href="' . $this->url('/login') . '">Login</a></li>');
         }
Mnkras replied on at Permalink Reply
Mnkras
also advanced permissions would not affect it, its probably a cache issue