Here is my situation:
I am using the Content Profile module to create a node profie for each user. For example I have node id#5 associated with my user id#2
Obviously to view a my user #2''s profile page, I have to navigate to http://www.mysite.com/node/5
I also use Panels to customize the profile page. In it I would like to place a Quick Tabs block that will have two tabs: one showing the current user's blog (for example) and one the shows the curent user's pictures. I have views prepared for both. Each of these views takes the "user id" as an argument.
With the current release of QT I can create a block with two tabs, select the appropriate view for each of them and pass %1 to the view. The problem is that when displaying a profile page thet %1 is a node id and not a user id! The ids of a user and his profile are generally not equal. So I need somehow to:
1) Get the node id from the path (%1)
2) Get the user id that is associated with that node
3) Pass THAT id down to the QT views
Do you have any ideas how this can be done?
I tried using a "panel pane" view - in the view definition you have the option to add a "panel pane" display for a view (in the same select box, where you add a block display). That display has an option to get its arguments from the panel context. And in the panel context I can easily define a relationship between a user and a node profile. The problem again is that this panel context is not available inside a QT. This leads me to a question: in the QT definition page, when you select a view, ALL view displays become available in the drop-down select box - including the panel panes. However those do not behave correctly since the panel context in passed through to them. Are only block displays working within a QT?
Comments
Comment #1
kirilius commentedOne more comment: I am sorry for including other modules in a QT discussion but after all this issue boils down to passing the Panel's context down to the views inside a QT.
Comment #2
pasqualletab type: view
page and block display should work within QT.
All I know about "panel pane" display is, that it is a new display type for panels. Never tried it..
Can you post screenshots about your settings. I am interested in the display setting inside the view admin interface, and any setting related to this panel pane. Thanks.
I know that panels have own arguments (@0, @1, @2, ..., @N), so if it is all what is needed, to pass those arguments to the view, then probably it could be an easily improvement to support panel pane display..
Comment #3
kirilius commentedHere are two screenshots:
- The first shows just the basic view settings: I am showing a thumbnail of an imagefield. I filter on the node type and published = yes. Note that the argument of the view is the User ID. It's pretty straightforward: show all galleries that are published and belong to user XXX.
- The second shreenshot shows the settings for the panel page display. The important one is called "Argument input". For the User ID source I have set the "From context" option.
What is happening is that in Panels you typically define a context and that context is a node im my case (I am overriding a node profile's display). Then I have added a related context for the user. Panels know how to internally extract that information and the user ID automatically becomes available in the panel's context. Now if I embed that view into my panel directly, it will correctly get it's user ID argument form the context. The issue here is when I place the view inside a QT - then the context is lost and the view does not know which user the current node belongs to.
Comment #4
pasqualleI checked how the panels pane is rendered and it is quite complex, and that won't be implemented in QT in the near future..
But for your original request: I think you need to add a content profile relationship to your view and use node id as a view argument.
Content profile has a relationship between user<->content profile, so if your view is user based then you can add a Content Profile relationship, and use the [content profile] node id as the view argument.. (did not tested, just checked the module code quickly)
Comment #5
kirilius commentedThanks a lot for the suggestion. The Content Profile view relationship works exactly as you said!
Comment #6
pasqualleproblem fixed..
the panels issue is here: #236925: Panels 3 as tab content