I have enabled the Blog module in order to have a blog for every user. Now I want to create a tab in each user profile that it links to that user's blog.
Is it possible? How can I do this?
You can also do this by either using the Views module or the Page manager module, without any custom coding:
In general, I would recommend that you build your own blog using custom content types and the Views module – it will give you more flexibility in the long run.
Good luck!
Using a custom module, you can implement hook_menu()
in the following way:
function mymodule_menu() {
$items['user/%user/blog'] = array(
'title' => 'My blog',
'page callback' => 'blog_page_user',
'page arguments' => array(1),
'access callback' => 'blog_page_user_access',
'access arguments' => array(1),
'file path' => drupal_get_path('module', 'blog'),
'file' => 'blog.pages.inc',
);
return $items;
}
The "file path" property is used because the module that defines the menu is not the one containing the "blog.pages.inc" file.
If you have few experience on how to create a Drupal module, you should start looking at: