Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By brollo on
Hi all
The default tab menu provided for user profiles is one with a "Account Settings" heading.
1)What if I want to change this header?
2) What if I want to place some of the fields in here to other groups (ie other tabs defined for user profiles??)
For example, the location module provides in the "Account Settings" section a form to enter location detail.
Now, I want to create a new group "Personal Information" and place the location stuff in this tab.
Can anyone point me out to solving these kinf of problems?
Thanks in advance
Comments
Create module and use the
Create module and use the the pathways to the user module in the menu code. This is an example that will and a tab and child links to the users tabs when they visit their account. This is for 4.7 so you will have to moddify it to suit 5.0 or 6.0.
Hiveminds Magazine | FireOrb | Drupal Street | Drupal offline manual
Thanks, but..
Hey, thanks
Could you be a bit more specific though. I know your code goes in the hook_menu for some module.. but..
What module do I create? Isn't changing drupal user module good enough in this case?
You could change the
You could change the user.module but I don't recommend it. Just create a module of any type or name. You could also add code to another contirbuted module. Unless you consider yourself satisfied with the version you are using or a Drupal expert, you want to leave a core file like user.module alone.
The syntax for drupal 6
Hiveminds Magazine | FireOrb | Drupal Street | Drupal offline manual
A single method module?
So what a module that only implements a menu hook? (apart from other non-harming ones: help, perm, etc.. )
And somehow make it override the user defaults? I still am not clear about how this would be done..
I am still searching for the total illumination
Thanks anyways
What version of Drupal are
What version of Drupal are you using?
Hiveminds Magazine | FireOrb | Drupal Street | Drupal offline manual
5.7
Drupal 5.7; linux ubuntu.
GOt it, but
Ok , I kind of managed to get it working even though the workflow is still not going right.
I have a module with just the hook_menu implemented. Just by the Paths that are entered the right tabs and submenus get automatically generated in the user profile page.
The question is now:
How do I change which fields appear under each tab menu?
For example, I'd like to put the user profile picture field into a single separte tag called "User Picture". How do I do that ?
Look at the code
Hey
I kind of am getting something now.
But I am still not really understanding how the whole work flow goes.
Example: For the user picture/avatar being rendered into a different tab menu item, I have now the following code in the costum module and hook_menu function
So, I added the "/picture" to the path key.. I dont know if this is right, I just made it up.
Then I put the callback in and this can be redirected to a function to render the appropriate form ..
I got the user profile for if I callback to a function such as :
The problems are that:
1) No submit button or submit button not working..
2) Still I dont understand how this whole thing can be handled.. For example: User location fields. (location.module) ; here I need to hack through the location module because it is the responsable for placing location form into the "account" tab!!
This what I have written so
This what I have written so far for trying to customize the layout under each user tab.
The thing I try here is to place the "user picture/avatar" field in a different tab "Picture" .
I try it in two different ways, with the _user hook and with the _menu hook.
I cannot get in one way the Submit button to actually submit and in other case ..
Can anyone help me fix this out please?
Have you tried avatar module
Have you tried avatar module from http://chapter3llc.com/? There is a tutorial and a module for your need there, no official release as I know this far, but the module just works fine if you only need to move user picture.
love, light n laughter
I have been struggling with
I have been struggling with this for a very long time. But I'm nearly zero at coding.
Would you be so kind as to attach your version of the custom module? or maybe upload it somewhere and provide the link.
Thanks
The problem is, that the
The problem is, that the individual contrib modules themselves choose in which category (tab) to put their fields, using the 'form' op of the hook_user function. Your module can even create your own categories with the 'categories' op.
It seems to me that there are no way no override the category choice of the different modules, so the only solution would be to hack each module's hook_user function and change the category each place! ... UGH!
Anybody got suggestion for another method?!
Below code will display
Below code will display Picture form under new tab "Picture" (Drupal 6):
Where are we supposed to put this code?
Hi,
Thanks for the code. But where are we supposed to put it?
I've pasted it in my theme's template.php , but nothing changed...
Thanks
You should place it in your
You should place it in your module it will not work from template.php
How to create module you can find here http://drupal.org/node/206753 , you will only need custom_module.info and custom_module.module files, this code should go to .module file :)
locations
I'm trying to modify Plazmus's picture-to-tab code to try an move the user locations fieldset to a profile tab but I'm getting this error
warning: Illegal offset type ....
has anyone done this before?
The best way to go about this
The best way to go about this is to:
1) Create a new view
2) Ceate a page display
3) Set the menu option in page settings to Tab (secondary links)
4) Go from there
I found this out after trying multiple programmatic ways of getting a tab in the user profile. I think you will be pleasantly surprised, especially if you are proficient with views.
This certainly seems like an
This certainly seems like an interesting work around.. A few more details would be appreciated . Thanks