Trying to create a custom menu link in a menu So I want to have different menu links depending on if a user has received a message or not.

I make a hook_menu() instance, like this:

/**
 * Implements hook_menu().
 */
function MYMODULE_menu() {
  global $user;
  $items = array();
  $items['user/' . $user-&gt;uid . '/messages'] = array(
    'access callback' =&gt; 'user_is_logged_in',
    'type' =&gt; MENU_NORMAL_ITEM,
    'menu_name' =&gt; 'main-menu',
    'title' =&gt; t('Messages'),
  );
  return $items;
}


However it only takes me to my user page, and not the messages (which should be a view at the path specified).

Is there a way to make it so that I can directly go from this item link in the menu to the view?
Got it from here:

http://zufelt.ca/blog/embedding-view-menu-hook-drupal

Changed my hook instance to this:

/**
 * Implements hook_menu().
 */
function MYMODULE_menu() {
  global $user;
  $items = array();
  $items['user/' . $user-&gt;uid . '/messages'] = array(
    'access callback' =&gt; 'user_is_logged_in',
    'type' =&gt; MENU_NORMAL_ITEM,
    'menu_name' =&gt; 'main-menu',
    'title' =&gt; t('Messages'),
    'page callback' =&gt; 'views_embed_view',
    'page arguments' =&gt; array('message_private', 'page_1'),
    'file path' =&gt; drupal_get_path('module', 'views'),
    'file' =&gt; 'views.module',
  );
  return $items;
}


This will embed the view into the hook_menu() instance.