This needs to be built, after #894028: multiple types.

Files: 
CommentFileSizeAuthor
#32 #01-profile2-tabs-894984.jpg78.12 KBnithinkolekar
#26 894984-profile2_edit_tab.patch14.44 KBklausi
PASSED: [[SimpleTest]]: [MySQL] 53 pass(es).
[ View ]
#25 profile2_edit_tab.patch14.43 KBfago
PASSED: [[SimpleTest]]: [MySQL] 53 pass(es).
[ View ]
#24 profile2_edit_tab.patch14.41 KBfago
PASSED: [[SimpleTest]]: [MySQL] 57 pass(es).
[ View ]
#22 profile2_edit_tab.patch13.19 KBfago
PASSED: [[SimpleTest]]: [MySQL] 57 pass(es).
[ View ]
#13 profile2_edit_tab.patch14.53 KBfago
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch profile2_edit_tab.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

Comments

fago’s picture

Please don't let us any more UI options or duplicated UI efforts directly into the module - this should be solved by extension modules. We could think about adding one directly into the project though. Profile2 should just do it like the core profile module.

joachim’s picture

That's pretty much the point of this issue, agreed.

AFAIK at the moment there's no output of profiles at all, is there?

fago’s picture

yep, the profile is just shown on the user account page (as for core profiles)

fago’s picture

Status:Active» Closed (won't fix)

as of now, it should just work as the core profile module. If not, please reopen.

tim.plunkett’s picture

Status:Closed (won't fix)» Needs review

I made http://drupal.org/sandbox/tim.plunkett/1268178 as a proof of concept, if you want to pull it in as a submodule you are welcome to.

It's vaguely hacky, but I'm open to other ideas.

joachim’s picture

I've cloned and enabled it but I'm not seeing anything different -- where should I be looking?

joachim’s picture

Oh I see -- does it only work when 'Provide a separate page for editing profiles' is enabled for a profile type?

tim.plunkett’s picture

#7, yes. Not well documented, but that was the easiest way to do it quickly. Could probably be done better ways :)

fago’s picture

Category:bug» task
Status:Needs review» Needs work

I could see lots of people wanting this, so maybe it would be a good idea to add support for it in profile2_pages? It's basically just a special page location, not?

joachim’s picture

Yup.

There's two ways to do it:

A. Put profile2 tabs alongside user account tab, with View and Edit subtabs

B. Put profile2 tabs alongside user account tab. Keep the editing of each profile2 under the main user Edit tab.

Personally I think B looks better, and it means you edit everything together. But we should maybe try to get UX input on this?

drewkeller’s picture

Am I missing something? The Profile 2 tabs module above only consists of a single file that all it does is refer to profile2_page ???

I imagine the below two items are working as intended:

* If I enable "Provide a separate page" on a profile type, the only way I can see that profile type is by accessing its URL (e.g. /profile-main/[userid]).

* If I disable "Provide a separate page", the profile is represented as a display button (I would not call it a tab per se) on the profile in edit mode and as a div under an h3 heading in view mode.

At one time, I was able to see fields for the profile type as non-collapsible accordion sections of the core profile page. However, now I can't figure out what combination of settings provided that output.

fago’s picture

fago’s picture

Status:Needs work» Needs review
StatusFileSize
new14.53 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch profile2_edit_tab.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.
[ View ]

ok, I've implemented that.

For that to work, I needed to move profile_form() into the main profile2.module - that makes sense to me though. Please review and test the attached patch.

Note: The patch comes with a small API change: The flags to disable user-category integration or user-account-view changes. That shouldn't be a big deal though.

joachim’s picture

Status:Needs review» Needs work
+++ b/profile2.api.php
@@ -159,8 +159,8 @@ function hook_profile2_view_alter($build) {
   if (isset($types['main'])) {
-    $types['main']->userCategory = FALSE;
-    $types['main']->userView = FALSE;
+    $types['main']->data['user_edit_tab'] = FALSE;
+    $types['main']->data['user_view'] = FALSE;

Does this change in type settings need documenting in the api file?

fago’s picture

I'm not aware of any common place in the documentation file for documenting stuff like that. There is the possibility to document it directly in the entity class though, where it's already documented. Maybe we should add an @see classname to the hook_profile2_load() docs?

Any feedback on the UI? Should the tab be "Edit $foo" instead $foo?

joachim’s picture

I've applied the patch and I can't actually tell what's changed...

I see tabs for each profile type at user/1/edit, but I see those without the patch as well.

fago’s picture

There is a new option when editing a profile type, where you can choose the tab location.

joachim’s picture

Aha, I see!

So without the patch, the edit location is a secondary tab, and the view location is within the user page itself.

With the patch, the edit location can be chosen to be put either as a secondary or a primary.

But the thing is, primary tabs on the user should not be 'edity' things -- there is a UX bug open on the shortcuts tab being a primary.

If you put a profile as a primary, it should be view + edit as secondary within that separate primary.

fago’s picture

Hm, really? It edits something that's visible at the user account page though, just like edit. I think it's a quite common wanted feature, as the secondary tab is rather deeply nested and probably too difficult to find.

Maybe we should try to get some feedback directly from ux people on this?

joachim’s picture

Cellar Door’s picture

Sorry to jump in on this but I noticed that when putting in the 1.x of your module Tim that it left the page at profile-profile_name/uid invalid due to the hook_module_implementation you have. Taking this out it leaves the profiles accessible via the profile-name/uid but basically imports that page into the users account in the tabs.

I'm not sure if this is useful for everyone but in taking this out I was able to give a profile landing page for other users to visit still and not have to mess with users getting into the user/ pathways when visiting account profiles. Again, it may be specific to what I wanted to do (place blocks on profile pages for specific viewers etc.) but it also makes it so when clicking the profile title in the tab the user isn't lead to a non-existant page.

I was beating my head for hours looking at how to clean up the UX in editing the profile pages as the secondary tabs weren't very easy for a user to follow. This makes it nice and simple.

Thanks!

fago’s picture

Status:Needs work» Needs review
StatusFileSize
new13.19 KB
PASSED: [[SimpleTest]]: [MySQL] 57 pass(es).
[ View ]

re-rolled the patch. Setting back to needs-review for as we need more feedback!

joachim’s picture

Status:Needs review» Needs work

When I saved a profile type to 'primary tab' I got:

Notice: Undefined index: user_edit_tab in profile2_menu() (line 517 of /Users/joachim/Sites/7-drupal/sites/all/modules/profile2/profile2.module).

fago’s picture

Status:Needs work» Needs review
StatusFileSize
new14.41 KB
PASSED: [[SimpleTest]]: [MySQL] 57 pass(es).
[ View ]

I noticed the added file is missing from the last patch, re-rolled it.

@#23: I'm unable to reproduce that, can you? If so, please tell me how.

fago’s picture

StatusFileSize
new14.43 KB
PASSED: [[SimpleTest]]: [MySQL] 53 pass(es).
[ View ]

Re-rolled patch.

klausi’s picture

StatusFileSize
new14.44 KB
PASSED: [[SimpleTest]]: [MySQL] 53 pass(es).
[ View ]

Rerolled.

rafamd’s picture

Patch worked fine in click, click testing, maybe RTBC ?

Not exactly what I was looking for though.

We need a separate profile page (with view and edit sub-tabs) that displays as a tab along the user account page primary tabs. Something like this patch enables, but for the "separate page for editing profiles" (right now, this pages are located in the user menu).

When "Provide a separate page for editing profiles." is checked, we could have radios to select the page location: a) user menu and b) user account page (primary tab). Option b) would have url: example.com/user/user-name/profile-name/ for viewing and same/edit for editing.

Like this option ? Any clue on how to go for it ?

Thanks !

Edit: corrected example url

fago’s picture

Status:Needs review» Needs work
fago’s picture

Status:Needs work» Needs review
polskikrol’s picture

Tried to use this, however, would appear that the profile information has now disappeared from the user/[uid] page. Thinking for clarity, there should be an option on where to show the non-edit view of the profile data.

webkenny’s picture

Issue summary:View changes

Unclear if this is related, but I think it is. Before I open a new issue, I wanted to check. The project page says this:

By default the UI behaves similar to the deprecated core profile module, thus showing each profile type in each own tab below user//edit. Via the included "Profile pages" module profiles can be viewed and edited at their own page and get their own menu link, e.g. "My profile".

However in no case do I actually see tabs on the user edit screens. Even as User 1. Do the patches here aim to do this or is this project page out of date?

nithinkolekar’s picture

StatusFileSize
new78.12 KB

OP's concern was display of profile but this issue moving towards providing separate edit tabs which is also fine but why not display other user profile in separate tabs?
profile2 pages module description says
Adds separate pages for viewing and editing profiles.
but when user with having permission to "view user profiles" and to "view any < individual profile >".
When try to view other user's profile then all profiles are shown below each other instead of tabs.