Hi,

I'm trying to figure out how to create a link in the menu using internal Drupal paths, like node/add/, that goes directly to a user's personal blog. (blog module)Basically the "my blog" link that appears under blog, but I want to place it elsewhere.
I simply can't figure out where to find the information, on this site or in the source code.

I've tried blog/user and blog/me going under the assumption the it is blog/'usernumber' but both take me to blog/.

Any pointers on how to do this? Information on possible internal Drupal paths would be very appreciated as well.

Thanks.

Comments

vm’s picture

investigate the path.module (http://drupal.org/handbook/modules/path) which is part of core & the pathauto.module (http://drupal.org/handbook/modules/pathauto) in the downloads area, this will make your task much easier.

sol77’s picture

Ah, thank you very much.

-----------------------------------------------------------------------------------------------
Siegetheday.Org

sol77’s picture

I just checked blog.module which confirms that the path is blog/'usernumber'

/**
 * Implementation of hook_menu().
 */
function blog_menu($may_cache) {
  global $user;
  $items = array();

  if ($may_cache) {
    $items[] = array('path' => 'blog', 'title' => t('Blogs'),
      'callback' => 'blog_page',
      'access' => user_access('access content'),
      'type' => MENU_SUGGESTED_ITEM);
    $items[] = array('path' => 'blog/'. $user->uid, 'title' => t('My blog'),
      'access' => user_access('edit own blog'),
      'type' => MENU_DYNAMIC_ITEM);
  }

  return $items;
}

See the row:

$items[] = array('path' => 'blog/'. $user->uid, 'title' => t('My blog'),

Didn't help me much though but maybe someone will find it useful. ^^

-----------------------------------------------------------------------------------------------
Siegetheday.Org

themegarden.org’s picture

take look at http://drupal.org/project/me
---
Drupal Themes Live Preview - themegarden.org

sol77’s picture

After looking through the blog, path and pathauto modules it seems the uid can't be reached with the internal path system as it is now. Unless I missed something, bear in mind that I don't know php very well. But the "me" or "pathauto" module will take care of my problem. Thanks VeryMisunderstood and themegarden.org for the help.

-----------------------------------------------------------------------------------------------
Siegetheday.Org