Posted by joachim on August 27, 2010 at 9:36am
| Project: | Profile 2 |
| Version: | 7.x-1.x-dev |
| Component: | User interface |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
This needs to be built, after #894028: multiple types.
Comments
#1
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.
#2
That's pretty much the point of this issue, agreed.
AFAIK at the moment there's no output of profiles at all, is there?
#3
yep, the profile is just shown on the user account page (as for core profiles)
#4
as of now, it should just work as the core profile module. If not, please reopen.
#5
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.
#6
I've cloned and enabled it but I'm not seeing anything different -- where should I be looking?
#7
Oh I see -- does it only work when 'Provide a separate page for editing profiles' is enabled for a profile type?
#8
#7, yes. Not well documented, but that was the easiest way to do it quickly. Could probably be done better ways :)
#9
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?
#10
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?
#11
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.
#12
marked #1292430: Skip default account page as duplicate
#13
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.
#14
+++ 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?
#15
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?
#16
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.
#17
There is a new option when editing a profile type, where you can choose the tab location.
#18
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.
#19
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?
#20
See #632210: user shortcut settings is in the wrong place for the shortcuts issue.
#21
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/uidinvalid due to the hook_module_implementation you have. Taking this out it leaves the profiles accessible via theprofile-name/uidbut 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!
#22
re-rolled the patch. Setting back to needs-review for as we need more feedback!
#23
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).
#24
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.
#25
Re-rolled patch.