My problem is as follows the path user/%user_uid_only_optional/profile is not displayed. If I try a variation of this and instead of having user, I replace user with usr the menu items is displayed. I know there was an issue with the page callback and I understand the issue of why it didnt work. That a boolean variable is not an expectable parameter for the page callback.
Line 1: line one is taken from the pro development book.
Line 2: line two shows the title (the title is displayed this line works)
Line 3: description is correct i checked syntax
Line 4: the page callback seems fine unless this isn't the correct format. I am quite sure that it follows what is in the
documentation.Line 5: the number of arguments are needed is one. Since I have only one %
Line 6: access arguments seems to be ok i checked the different permission in drupal under users and that is the edit person that i
used.Line 7: I looked at the menu type and it discusses at the parents level if you want to use the local version of the menu you type
$items['usr/%currentuser/edit'] = array( 'title' => 'Profile', // The link text 'description' => 'My Profile', 'page callback' => 'editprofile', // the function to be called when link is clicked [below] 'page arguments' => array(1), // arguments for the callback function 'profile_use_page' 'access arguments' => array('edit own profile'), 'type' => MENU_NORMAL_ITEM, 'menu_name' => 'user-menu', // You'll need to have a menu named my_menu for this to work // If not specified, it will default to 'navigation' );
function editprofile($user_id) {
return 'user_id'. $user_id;
}
page callback
is a Boolean instead of a function maybe?