I have a panel page with two arguments in the path. In one panel (currently the only panel) I have a view that accepts both arguments.

I have tried using the following in the path when setting up the page: page/%/%, page/%0/%1, and page/%1/%2. I have also attempted to use the following in the settings when adding the content. "%0, %1", "%1, %2".

So far none of these has worked. When I use page/%/% the page will display, but it does not include the output from the view. All of the other path configurations results in a "page not found" message. The page/%/% will only give options for a single argument in the panels setup options, but the other options do show two arguments.

Any suggestions to get this to work?

Comments

schedal’s picture

I just came to this issue section to file a problem with passing multiple arguments.

Let's say you have a panel called:

page/

So you pass it two arguments: let's say this is configured directly in the Menu

page/solutions/rose

In order to pass these two values to a View, you need to do the following exact steps:

1. Don't bother making the view anything but "default", because if you choose another option it WON'T work [you'll just loose hours wondering why]
2. In the View, if you have it set up to read: arg0/arg1 you will need to FLIP this backwards (!) when sending them from the Panel.
3. Panels thinks that the first argument is actually the word "page" [or at least I think this is what it is doing], so the arguments you want to send are NOT %0/%1 like you would expect, but %1/%2
4. Put this all together: reversed order and skipping the first parameter in the URL, and you end up with the following in the Panel->View settings page:

pass arguments [checked]
%2/%1

This is HIGHLY counter intuitive, and if it wasn't for me spending HOURS figuring this out by trial and error, I would have just listed it as broken. I would have thought this would be fixed in Panels 3, but the same problem [and solution] is the same as in Panels 2.

If anyone can look into making this a lot more logical in a future release, it would be greatly appreciated!!

Hope this helps someone else until the issue is resolved more appropriately,

Best regards,

Sebastian.

schedal’s picture

Category: support » bug

I think it makes sense to file this as a "bug" since it really doesn't work the way someone would expect it [and unless you find my work-around above you would never know how to solve it]. If I am wrong, then please enlighten us as to how this is done, as it is really not obvious w/o flipping the arguments. Thanks!

merlinofchaos’s picture

Status: Active » Closed (works as designed)

You should very very carefully read this text, which is the help text for the textfield where you give arguments:

Additional arguments to send to the view as if they were part of the URL in the form of arg1/arg2/arg3. You may use %0, %1, ..., %N to grab arguments from the URL. Or use @0, @1, @2, ..., @N to use arguments passed into the panel. Note: use these values only as a last resort. In future versions of Panels these may go away.

Now, compare this to:

3. Panels thinks that the first argument is actually the word "page" [or at least I think this is what it is doing], so the arguments you want to send are NOT %0/%1 like you would expect, but %1/%2

What you really want is @0/@1

Actually, what you *really* want is to just check the box that says "Send arguments".

I don't understand why you think you have to flip the arguments, though. At no point are the arguments reversed.

The whole text to use that only as a last resort seems to have not deterred you in the slightest, for example.

schedal’s picture

I've never been able to use that "send arguments" checkbox; it has never seemed to work for my websites, hence the maneuvering. Next time I have to use panels, I'll try it again. Thanks.

djguerri’s picture

I had the same problem and I fixed it by configuring in an appropriate way the arguments you send from the page (admin/build/pages/edit/[name_of_the_page] -> Options -> Arguments) to the referenced view.

The steps I followed to come up with the solution were:

1) In the page path, I set have something like: /home/categories/subcategories/%parent_term/subcategory/%term
2) Automatically, two new arguments appeared in my page, named "parent_term" (in position 3) and "term" (in position 5)
3) I configured both arguments to have the context "Taxonomy term: ID" (by clicking "Change" button in "Context assigned" column) and as options I set "Argument type = Term ID" (by clicking "Options" button in "Operations" column)
4) Then, in "Variants" -> "[name_of_variant]" -> "Content" section, I configured the referenced view options to set the two dropdown lists (each one representing one of the two view arguments) to the appropriate arguments of the page: "parent_term" & "term" (I think that is in this point is where you're having the issue with the reversed parameters, so be careful with the element you select for each dropdown list).
5) Finally, I checked the "Send parameters" checkbox, since my page has two arguments and the view expected the same two paremeters too (I left the argument textbox empty).

Good luck!