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.
This needs to be built, after #894028: multiple types.
Comment | File | Size | Author |
---|---|---|---|
#39 | profile2_view_subtab-894984-39.patch | 10.79 KB | RickJ |
| |||
#32 | #01-profile2-tabs-894984.jpg | 78.12 KB | nithinkolekar |
Comments
Comment #1
fagoPlease 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.
Comment #2
joachim CreditAttribution: joachim commentedThat's pretty much the point of this issue, agreed.
AFAIK at the moment there's no output of profiles at all, is there?
Comment #3
fagoyep, the profile is just shown on the user account page (as for core profiles)
Comment #4
fagoas of now, it should just work as the core profile module. If not, please reopen.
Comment #5
tim.plunkettI 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.
Comment #6
joachim CreditAttribution: joachim commentedI've cloned and enabled it but I'm not seeing anything different -- where should I be looking?
Comment #7
joachim CreditAttribution: joachim commentedOh I see -- does it only work when 'Provide a separate page for editing profiles' is enabled for a profile type?
Comment #8
tim.plunkett#7, yes. Not well documented, but that was the easiest way to do it quickly. Could probably be done better ways :)
Comment #9
fagoI 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?
Comment #10
joachim CreditAttribution: joachim commentedYup.
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?
Comment #11
drewkeller CreditAttribution: drewkeller commentedAm 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.
Comment #12
fagomarked #1292430: Skip default account page as duplicate
Comment #13
fagook, 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.
Comment #14
joachim CreditAttribution: joachim commentedDoes this change in type settings need documenting in the api file?
Comment #15
fagoI'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?
Comment #16
joachim CreditAttribution: joachim commentedI'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.
Comment #17
fagoThere is a new option when editing a profile type, where you can choose the tab location.
Comment #18
joachim CreditAttribution: joachim commentedAha, 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.
Comment #19
fagoHm, 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?
Comment #20
joachim CreditAttribution: joachim commentedSee #632210: Move shortcut settings from user/%user/shortcuts to user/%user/edit for the shortcuts issue.
Comment #21
Cellar Door CreditAttribution: Cellar Door commentedSorry 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 theprofile-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!
Comment #22
fagore-rolled the patch. Setting back to needs-review for as we need more feedback!
Comment #23
joachim CreditAttribution: joachim commentedWhen 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).
Comment #24
fagoI 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.
Comment #25
fagoRe-rolled patch.
Comment #26
klausiRerolled.
Comment #27
rafamd CreditAttribution: rafamd commentedPatch 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
Comment #28
fagoComment #29
fagoComment #30
polskikrol CreditAttribution: polskikrol commentedTried 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.
Comment #31
webkenny CreditAttribution: webkenny commentedUnclear if this is related, but I think it is. Before I open a new issue, I wanted to check. The project page says this:
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?
Comment #32
nithinkolekar CreditAttribution: nithinkolekar commentedOP'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.
Comment #33
junaidpvI am not exactly sure how the patch is evolved to having more complex changes. As per original issue report, subtab under user profile "view" and "edit" tabs would be fine. Current version of this module already allow us to have subtabs for profile2 editing under user edit tab. We just need to turn off "Provide a separate page for editing profiles." in profile2 type edit page.
But it doe not provide sub tab for viewing profile2 info under user view page. Instead it displays profile2 data along with default user page content. We also encountered with same requirement now and I developed a fresh patch. That is attached here.
It will bring a new setting (checkbox) labeled "Provide a separate tab for viewing profiles." under profile2 type edit page (admin/structure/profiles/manage/). It will be visible only if we turn off separate page for that profile type by unchecking "Provide a separate page for editing profiles.". You will get separate sub tab for viewing profile2 profiles.
Comment #34
edvanleeuwenThe patch given by junaidpv does indeed give the proper viewing options. However, it does not seem to follow the permissions. It is only displayed when the option 'Administer profiles' is set (or as admin). I would like users to display their information and subsequently give set '[..]: View own profile'.
Comment #35
edvanleeuwenI have tried to create a patch for the permissions, see 1836322. Unfortunately, this breaks the tabs patch.
Comment #36
AlfTheCat CreditAttribution: AlfTheCat commentedTried patch from #33 but nothing is happening. I'm not seeing a setting on when editing profiles to enable the tabs. And I don't see any tabs on user_view either.
Comment #37
junaidpv@AlfTheCat, you need to uncheck "Provide a separate page for editing profiles." to make "Provide a separate tab for viewing profiles" checkbox to appear.
Comment #38
pyxio CreditAttribution: pyxio commentedthe patch #33 does not work for me using dev version. i get notice
Notice: Trying to get property of non-object in profile2_profile2_access() (line 752 of /var/www/html/skypyx/sites/all/modules/contrib/profile2/profile2.module).
Comment #39
RickJ CreditAttribution: RickJ commentedThis enhancement has been kicking about a long time, and I decided to have another look at it. Patch #33 has a definite bug as reported in #38 by @pyxio.
I've worked through and tidied it up, and added a few more enhancements to make it work more smoothly. In particular to get the page and profile titles to make sense and be consistent. It needs #2845725: Profile2 objects don't return useful label values for this to work properly - that's now been committed so I recommend installing the dev build if using this patch.
Please also clear cache after applying the patch.
If you display profiles in tabs, then there is a nice symmetry with the standard editing of profiles in equivalent tabs. Also, if you're viewing a profile tab and you click Edit, you go to editing the same profile (subject to permissions).
I'd like to include this in the next release, so feedback will be appreciated.
Comment #41
RickJ CreditAttribution: RickJ commentedComment #43
RickJ CreditAttribution: RickJ commented