I am looking to customize the user experience for viewing and editing account and profile information (i.e., custom fields added to the account page and to a Profile2 profile type. To achieve this I have been editing user_view and user_edit with very mixed and seemingly inconsistent results. I wanted to ask if editing these pages was the right approach. If so, is there some reference I can use to guide my efforts. If not, could someone point me in the right directions. I have been at this since last Saturday and have probably put 8 hours into it :(.

Thank you for any suggestions or info you have!

Comments

nevets’s picture

It would help to know what type of customizations you want.

As for adding fields that should be done using the ui (easier) or hook_form_alter() and not user_edit.

If you mean you have been editing the functions user_view() and user_edit(), one should never modify core code as it makes updating Drupal hard.

klequis’s picture

Thank you for the reply nevets.

I am new to Drupal and was hoping to do this without coding since my background is C# and I don't know PHP yet. However, if my goal can't be reached without coding then it would be good to know that so I could stop putting my time in the wrong direction.

I want to collect user data in 2 steps
1. a few fields when the user registers including first and last name
2. considerably more data after users' first login
For this, I have added fields under Account settings>Manage Fiels and the rest of the data is in a Profile2 Profile type.

I want the user to have a place to go where they see all the information from registration/account and the Profile type on one page - no tabs. I want this page to have a 2 column layout and I want to add some styling/css. Importantly, users will be viewing eachother's profiles using this page so I need to be able to give view permissions to all authenticated users.

For editing this data, I want the user to be able to edit all the data on one page. Layout is less important but 2 columns is desired.

nevets’s picture

Personally I would not use profile2 in this case. You can denote fields added to the user object as being on the registration form (or not). Placing the fields in one place makes them editable in one place.

I would consider using the Display Suite module, it provides the option for layouts (including 2 column) and has an optional module to do the same for the add/edit form.

klequis’s picture

Thanks for pointing that out. This issue here is that 'Required field' and 'Display on user registration form' are tied together. If you check 'Required field' then 'Display on user registration form' is automatically displayed. For the fields that will not be show on the user registration form I definitely need the required field functionality. Do you know of a way around that?

manumad40’s picture

I know I'm replying to an old issue, but maybe this can help anyone in the same course at any moment.

The Account Profile module can help you "to integrate profiles into account's user form".

The result is only one page displaying both fields from the user account and from Profile2 profiles as well, all the fields together without tabs.