Closed (duplicate)
Project:
Profile 2
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Jul 2011 at 23:27 UTC
Updated:
21 Sep 2018 at 19:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
smithmilner commentedThis is still a ways from complete but it works!
Comment #2
smithmilner commentedI've found that view modes can be missing depending on profile2's order in the hook_entity_info_alter(). This is stab in the dark to try and get a final result on the user entity.
Comment #3
smithmilner commentedhello?
Comment #4
fagoSounds good to me, the hack in the entity-info-alter hook is very ugly though. I think just inheriting the view-modes that are available during alter should do it - if someone adds one in after us, he can do it for profile2 too.
Comment #5
smithmilner commentedOk, we'll go back to the first version of the patch to avoid ugly hackyness. Another small issue here is that users have a view mode called "full" which for all purposes is identical to profile2's view mode "account". After the profile2 inherits user view modes we end up with a duplicated view mode as seen in the second screenshot. I think it would be ideal to change the machine name of profile2's view mode to be "full" so it's inline with users. I haven't thought about what sort of implications that might have, what do you think?
user view modes: https://skitch.com/smithmilner/gc9au/welcome-to-participedia-participedia
profile2 view modes(after patch): https://skitch.com/smithmilner/gc9ab/welcome-to-participedia-participedia
Comment #6
langworthy commentedComment #8
smithmilner commentedaha, editor renamed it to .txt. Let's try this again...
Comment #10
smithmilner commentedRerolled against dev.
Comment #11
kevinquillen commentedThat patch worked for me! Went in circles for two hours on this.
Comment #12
fagoShould start capitalized and end with a point, in short it should be a full sentence.
This is changes the view-mode which is used by default, which might break people's settings.
Thus, we cannot change the default view-mode. Maybe just go with 'account' for view mode "full" and pass through others.
Comment #13
mpgeek commentedHere is another version with a more general approach that takes into account the fact that default view mode for profile2 is
accountthat is associated with thefullview mode for user, as pointed out in #12. A more general approach would likely be to implement view modes along the lines of the way entity reference provides display mode configuration when attaching to another entity.Comment #14
sophie.skApplied the patch and it seems to be working for me - thanks! :)
Comment #15
rickj commentedClosed as duplicate of #2148375: Displaying a profile with a specific view mode. The actual code fix is a one-liner, there is no need to map 'full' to 'account'.
If a view mode doesn't exist the display falls back to the default. The system displays the regular user account page using view mode 'account', but there is no need to preclude adding 'full' as another view mode for other purposes.