1

On the "My Account" page i.e. /user, the account and Profile 2 information is by default residing in the content region. I would like to move everything to the right sidebar region. Any suggestions on how I can achieve this ?

I am using Bartik

Thanks in advance.

1 Answer 1

1

You can create a View (show Users) with display "block" and add User:ID as Context Filter. For the Context Filter set "When the filter value is NOT available" to "provide default value - User ID from URL". Add all user fields that you would like to output to your view. Created Views block will then be listed on you Blocks page (structure > blocks). Once the block is there, you can drag it into the sidebar region.

If you need to remove user profile fields that are rendering in content region by default or override them, you can do so by overriding "modules/user/user-profile.tpl.php" - copying it into your theme's template folder and replacing the line that renders user profile - <?php print render($user_profile); ?> with the desired content.

Page Manager Existing Pages + Panels is another convenient method of changing the layout of user profile. This method will work in combination with existing layout regions.

7
  • I got up to contextual filter part, but after that I don't see any profile related fields in the "add fields" list. Any ideas?
    – p Ng
    Jan 17, 2016 at 9:32
  • edited the answer with more details -check it out
    – oksana-c
    Jan 17, 2016 at 10:43
  • I only got the profile fields when I chose "show Profile", instead of "show Users". Is that how it is meant to be?
    – p Ng
    Jan 18, 2016 at 0:07
  • yes, If you created a view with contextual filter of User:ID it will only show fields for one user when the context filter is available - means, only when you are viewing single user profile.
    – oksana-c
    Jan 18, 2016 at 0:32
  • I am now using "show Users" for the Views block. The User fields are showing fine, but the Profile fields are empty (I added the User: Profile relationship). I also made sure the profile fields were filled with values. How do I solve this?
    – p Ng
    Jan 18, 2016 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.