Can someone give me simple, step by step instructions on how to pass an argument from a panel (Panels 2) to a view? I've been at this for hours, and have tried multiple methods I've found in searches, but nothing works.
What I've done is created a View that take an argument. The argument is a content type. When the View receives a valid argument, it displays a list of nodes only of that content type. So far so good. My view works fine when I view it on it's own.
What I want to do is put that View in a Panel Page, so I added a Panel pane to the View, and set argument input to "From panel argument". I created my Panel Page, and set the path to paneltest/% and added the View as a pane. In the configuration for the pane, I checked "Send Arguments".
But, when I navigate to view the Panel Page, it gives me an Access Denied message (despite being logged in as user 1). I know the Panel is working, though, because if I change it's path so that the argument is hardcoded in (i.e. paneltest/myview), it works just fine. Unfortunately, it kind of defeats the whole purpose for me, as I don't want to create a separate panel for every content type.
What else do I need to do get the Panel to pass the argument on to the View?
Comments
Anyone? This is really
Anyone? This is really stalling things for me...
If you find a solution, just
If you find a solution, just tell me, I've got exactly the same problem.
Seriously... someone out
Seriously... someone out there's got to be able to point me in the right direction here...
Hello, I found a working
Hello,
I found a working solution, bypassing the "Access Denied" issue, even if I guess there still a bug.
* I simply removed the argument in the tab "parameters" (paneltest instead of paneltest/% with your example)
* In the tab "context", I added an argument (a taxonomy ID in my case). Let's call it "myterm".
* When configuring a "view" content in the "content" tab, there is a context dropdown list which is set to "no context" by default. You can select your argument here ("myterm" in my example).
* If your view accepts an argument this one will be set according to the URL (www.example.org/paneltest/5 will pass the argument 5 to the view).
* You don't need to use "send argument", but using it with %0 is similar to the previous method.
I hope this helps.
Marc
It took a little tinkering,
It took a little tinkering, but that seems to work (for some reason, using %0 when configuring view content gives me a blank page, but %1 brings my view up in the panel, no problem... go figure). Thanks! ^_^
painful, but here it is:
Hello, here is the solution for Views 2 and Panels 2 on Drupal 6: this was very painful, and I would agree that it is not working as you would imagine.
Here is how I got it to work:
Set up your view, and don't even bother making it into a panel, we will be using the DEFAULT pane only.
NOTE: if you use the Panel pane and select Argument input -> 'Input on pane config' or 'from panel argument' it will NOT work!! [counter to logical thinking]
Set up your panel, add in the content area your view as the DEFAULT [do NOT add it as a pane or it will not work!]
In the settings, where it says arguments, write in the field: %1 for the first one, %2 for the second one etc.
No fancy PHP code required or any other hacks.
It will now work, and hopefully you didn't spend 8+h trying to figure this one out like I did...
This must be a bug, it's terribly counter intuitive.
painful solution works
Hi, thanks for your solution. I had a similar problem and it worked the way you suggested.
Bottomline is not to add a "content pane" to the view but just to use the "default view" and add that to the panel.
I think I have found a way to
I think I have found a way to do this:
http://itscommonsensestupid.blogspot.com/2009/04/passing-arguments-from-...
Simpler in Panels 3
For what it's worth, in Panels 3 you just need to check "Send arguments" to the view and it works fine as expected ...
Seán
Where?
Where precisely do I check "Send arguments"?
Maybe stupid, but can not find it....:-(
Problem solved
I had the same problem, but decided. The passing arguments to the panel to view or a pre-existing node is not on, for glass scintillation
http://www.exemple.com/node/36/
(url address of my panel)
it I load 1 view (default) and had to pass an argument to her. Not was necessary to mark the checkbox 'Send arguments "just have an argument in' Arguments: '% 2, where %0 = node, %1 = 36 and %2 is in fact the argument that you will run through the url:
http://www.exemple.com/node/36/29
where 29 is the argument passed to the view that the panel loads.
Another point to consider is the module auto-path that was renaming my url to:
http://www.exemple.com/painel/edits
and that if I try to pass the argument this way:
http://www.exemple.com/painel/edits/29
did not work at all (Page not found)
I read this topic I realized that there is a problem understanding on passing argument by the panel, that different views of the passing of argument is absolutely not on.
I hope I have helped, and sorry for my bad English, is that I am Brazilian and I am perfect to read and understand but bad to speak and write rsrs