If you want just another page with information about the user try the profile module. You can set categories for the user profile, define what information in this category can be provided by the user and the it will be a tab on the user page.
---
Want to exchange with the community in chat for free and archived? Join us on drupalchat.me
I am trying to add content to the View, Edit, Track tabs when the user is logged in as well. I would like to delete the TRACK tab (I have tried some of the tutorials on here but they have not worked for me yet) and add a LOGOUT tab as well as a NEW POST tab. I would also like to alter the names of the other two tabs so they make sense to someone who is a newbie user. I have read a lot about people customizing the hook menu. I will let you know if I find out anything.
If anyone else has some suggestions please let us know.
Thank you.
I just wanted to say this forum has helped me out a lot! Thank you all!
I am actually trying to do the same but it's not what "profile" module is really meant to exist for. Because, from what i know and what i am learning these very months and weeks, profile is a module that help you providing more information about the user. If you think that in your system the drupal user is not enough detailed you add information with that module.
But if you want to add a specific tab to add information about how to manage your custom module, which is my specific case, you have to create that tab from code (and frankly i believe that the less dependencies you set the better).
I am trying to figure it out from other modules that create custom tabs in the user section i.e. "quiz" or "devel" but still, as i am pretty much a newb to drupal, i can't really understand how (also 'cos those 2 modules in particular are pretty "big" for me right now to understand deeply).
PS: This is my request as i already set up a custom field for what i need but it appears in the "View" tab of the user profile section and i'd like to separate it more strongly and just do the work better.
POST EDIT: I post this to whoever needs the information i asked for. To create a new tab in the user profile such as the already present ones ("View", "Edit" and others that custom modules might add) you have to use hook_menu and NOT hook_user. Seeing that now it was pretty obvious.
This is the code you need to implement in your module
function user_queue_book_menu() {
$items['user/%/newtab'] = array(
'title' => 'Title of the tab',
'page callback' => 'whatever drupal system should trigger after you click on the tab',
'page arguments' => 'whatever parameter you need to pass, if any - default is 'array(1)' ',
'access callback' => 'i am not sure about this but i think this is needed to check if the user has permission to access all this',
'access arguments' => 'same as above - default is 'array(1)'. Not sure about all this "access" part tho',
'type' => MENU_LOCAL_TASK
);
Obviously correct me if i am wrong...I hope this will help somebody...especially the topic creator :)
Ok after looking for a while , I Can Offer some advice , I only wanted to ad some custom (static) content
to the normal user profile (my account page - with out profile enabled ) ,
So I Created a modual Called : custom_mod
and in custom mod i made:
<?php
// the full contents of a new mod ... custom_mod.module 6.x
function custom_mod_menu() {
global $user;
$items = array();
// rename this to what ever
$items['user/%user/hello'] = array(
// rename this to what ever
'title' => 'hello',
'page callback' => 'customs_content_get',
//'page callback' => 'drupal_get_form',
// 'page arguments' => array('user_profile_form', 1),
'access callback' => TRUE,
'type' => MENU_LOCAL_TASK,
);
return $items;
}
function customs_content_get() {
return ' <h2>Hello World...</h2>';
}
?>
Comments
What should this tab
What should this tab contain?
If you want just another page with information about the user try the profile module. You can set categories for the user profile, define what information in this category can be provided by the user and the it will be a tab on the user page.
---
Want to exchange with the community in chat for free and archived? Join us on drupalchat.me
I want to have additional
I want to have additional links: send message and guestbook.
Trying to do the same too
Hello,
I am trying to add content to the View, Edit, Track tabs when the user is logged in as well. I would like to delete the TRACK tab (I have tried some of the tutorials on here but they have not worked for me yet) and add a LOGOUT tab as well as a NEW POST tab. I would also like to alter the names of the other two tabs so they make sense to someone who is a newbie user. I have read a lot about people customizing the hook menu. I will let you know if I find out anything.
If anyone else has some suggestions please let us know.
Thank you.
I just wanted to say this forum has helped me out a lot! Thank you all!
Track tab
I got rid of the track tab by disabling the track modual in the moduals page. Also there is a statistic role you can disable I believe.
I am actually trying to do
I am actually trying to do the same but it's not what "profile" module is really meant to exist for. Because, from what i know and what i am learning these very months and weeks, profile is a module that help you providing more information about the user. If you think that in your system the drupal user is not enough detailed you add information with that module.
But if you want to add a specific tab to add information about how to manage your custom module, which is my specific case, you have to create that tab from code (and frankly i believe that the less dependencies you set the better).
I am trying to figure it out from other modules that create custom tabs in the user section i.e. "quiz" or "devel" but still, as i am pretty much a newb to drupal, i can't really understand how (also 'cos those 2 modules in particular are pretty "big" for me right now to understand deeply).
PS: This is my request as i already set up a custom field for what i need but it appears in the "View" tab of the user profile section and i'd like to separate it more strongly and just do the work better.
POST EDIT: I post this to whoever needs the information i asked for. To create a new tab in the user profile such as the already present ones ("View", "Edit" and others that custom modules might add) you have to use
hook_menuand NOThook_user. Seeing that now it was pretty obvious.This is the code you need to implement in your module
Obviously correct me if i am wrong...I hope this will help somebody...especially the topic creator :)
Tab in the normal User Account
Ok after looking for a while , I Can Offer some advice , I only wanted to ad some custom (static) content
to the normal user profile (my account page - with out profile enabled ) ,
So I Created a modual Called : custom_mod
and in custom mod i made:
I Hope this helps save you some time.