views:

39

answers:

2

Hello, Im trying to append an item to a menu that I created.

I know its get the primary and secondary menus using "menu_secondary_local_tasks()" etc, and then add items within preprocess page. How would I go about this with a menu that I created?

Here is the code I am using to check is the user is logged in...

function themeName_check_login() {
    global $user;
    if ($user->uid) {   
        print l("Log out, " . $user->name,"logout");
    } else {
        print l("Log In ","user");
    }   
}

Thanks in advance, -Matt

A: 

If you call menu_navigation_links with the name of your menu, you should get an array of links formatted for the current page, which you can then easily add to before display.

cam8001
A: 

It's not necessary to verify if the user is logged in; the login link will not be visible to users who are already logged in, and the logout link will not be visible to users who are not logged in.

kiamlaluno

related questions