1

I am having a hard time setting up my Panels page for the user profile page ie: /user/%user

I am using the "Reference" module, and have my content type "News" reference users. I created a view for this called "User News Reference" to make sure it is working correctly. The view has a "page" and a "block". The "page" display for the view correctly returns the referenced data when you manually put the user's id in the path.

I then went to panels and used the Panel's page for the User Profile Page, ie: /user/%user I created a variant and my user's profile to the top of the content and then I added the view "User News Reference" to the center content. I then loaded the user page with a valid user that has referenced "news" content, but the referenced material never shows up.

I created images of every step along the way to help you help me diagnose the problem:

1) First here is my view that I created that returns "news" content that references the user.

enter image description here

2) Here is the view in page display showing the "news" content that references the user with id = 1 (added to show that the references are configured correctly)

enter image description here

3) here is the panel page. In the context section I first have the User Profile, and then the "User News reference" view. I followed it up with some custom content to show that the panel page is actually loading correctly and the page shown is the User Profile Panel page.

enter image description here

4)After setting all of that up here is the page for user 1. This is the Panel's version of the user profile. Note that you can see the profile and the custom content, but not the "news" referenced content from the view.

enter image description here

5)To be sure that the view was loading properly, I went to the view and changed the contextual filter from "display no results if the filter value is not in the url" to "display all results for the specified field" and reloaded the user profile for user 1. then all of the "news" content is returned on the user profile page for user 1, proving that the "User News Reference" view is loading properly for the user profile panel.

enter image description here enter image description here

Can someone help me understand what I need to do correctly to get the user:Uid to show up in the url for the view used in the panel? I believe the view used in the panel is using the "block" display of the "User News Reference" view, but not sure how it is misconfigured.

I thought it might have something to do with the "context" section in for the Panels User Profile.

enter image description here

I thought I had to add another context, and tried under "user", but the only option was the currently logged in user, or a user by name.

1 Answer 1

1

The %user portion of your URL is called an argument. Your final screenshot shows that argument and that you can use %user_uid in your page. So that's the context handled.

Instead of a page or block, make a content pane for your view, you will need to enable the Views content panes if you haven't already.

In that content pane, set your argument to From context and choose User->User ID from the dropdown. This tells the view where to get the information for your contextual filter (which looks ok I think).

Once you have saved that, go back to your page in page manager and insert the view pane as content, it will ask you where to get its argument from, choose Argument 1 because that will refer it to the %user portion of your URL.

2
  • Thanks so much for responding! I'm off for the weekend, but will try that right away on Monday morning! :)
    – David Pugh
    Jan 9, 2015 at 5:54
  • 1
    This worked like a charm! Thanks so much. Just a clarification that took me a few extra minutes, you set the Argument 1 (That is supplied by the Panel) in the Content Pane View page under "Argument Input".
    – David Pugh
    Jan 12, 2015 at 17:55

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.