By mattyoung on
I want to define a menu item that does the same thing a the url '/user'. Where is this menu item defined so that I can copy it to my module?
Anyway, I try this but it doesn't show the login form, instead, just the word 'array':
$items['account/login'] = array(
'title' => 'Login/Create Account',
'page callback' => 'user_login',
'page arguments' => array(NULL),
'access callback' => 'user_is_anonymous',
'type' => MENU_NORMAL_ITEM,
'weight' => 1,
'menu_name' => 'account_links',
);
Comments
I found it
in user.module line 896.
Why are you needing to do
Why are you needing to do this? Look here: http://drupal.org/project/loginmenu
- Corey
loginmenu is exactly what I need
Thanks for pointing me to loginmenu. That's exactly what I need. But I need the login/logout in my own menu instead of in navigation. The loginmenu module add the item to navigation.
Another little thing I want is to inject a bit of javascript to make the cursor move to the user name field of the login form so that the user can start typing their user name without needing to mouse click first. So I got to do it with my own module.
Anyway, I got it working.
Thanks!