1

This question already has an answer here:

Site link

here, in this 9 is the user id.it is different according to register users.

When add link in main menu there is an option Path textbox in that text box if i add "user/9/edit" then link is created but here 9 is login user id. then it is accessible only whose user id 9. but other not access. I want to add link dynamic which user are login then that user access that user edit page.user/*/edit

marked as duplicate by sanzante, Mołot, Shawn Conn, Krishna Mohan, Scott Joudry Oct 29 '15 at 12:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • have you tried user/*/edit in main menu – Adeel Nawaz Oct 27 '15 at 10:36
1

Install me aliases module.

Provides shortcut paths to current user's pages, eg user/me, blog/me, user/me/edit, tracker/me etc.

0

Menu token

Menu Token module provides tokens, that could be used in title or in path of menu items (links). For example, if you create a menu item with path: "user/[current-user:uid]", the url will be changed "on fly" to: "user/1" (assuming you are user 1).

or you can do it by using hook_menu_alter

/**
 * Implements hook_menu_alter.
 * Check access for forum menu item.
 */
function MYMODULE_menu_alter(&$items) {
  $items['forum']['access callback'] = '_accesscheck';
}
/**
 * Callback to disallow access for the anonymous user.
 */
function _accesscheck(){
  global $user;
  return $user->uid;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.