I didn't know exactly where this would fit so decided to put it in this folder.

I have multiple views that all display as block and are set up to receive two arguments of the type "Taxonomy: term". I've tested all these views in Views Edit, Live Preview and all are functioning correctly. All these views are used by a panel page with a url of domain/filtered/%state/!city. Under the panel arguments tab I have the arguments set up thus:

Argument Position in Path Context Assigned
%state 1 Taxonomy term: ID
%city 2 Taxonomy term: ID

If I navigate to the page using no arguments "domain/filtered" I get Page not Found. However, if I use arguments "domain/filtered/oklahoma/owasso" I get the page but all nodes as if there is no filtering taking place.

I've looked all over and haven't found a solution to this but know this has to be basic argument functionality. Any ideas?

Comments

merlinofchaos’s picture

You put this in Views, but you're describing arguments on Panels.

If I navigate to the page using no arguments "domain/filtered" I get Page not Found.

This would be the expected behavior. The % indicates a required argument.

However, if I use arguments "domain/filtered/oklahoma/owasso"

Have you configured the pane to properly use the contexts? Contexts and arguments do not automatically get transmitted from the Panel to the View. And there are many, many different ways to configure this, so you need to be very specific about how your view panes are configured.

fblevins’s picture

Thanks Merlin and sorry about the mis-categorization (I was thinking about arguments so immediately thought "views"). And yes, I think you're correct when you talked about how contexts and arguments not getting transmitted automatically and believe this may be the missing piece to the puzzle. Do you know of any resources to get educated on this or could you supply a synopsis of what I need to do here?

What I basically have is one panel that contains multiple mini-panels, each with 1 to 2 views. All the views will receive identical arguments (state/city) so the user can select his/her location via hierarchical select. Since I know now that the arguments are getting passed to the page all I need to do is figure out how to get them to propagate down to the individual views (or am I thinking of this too simplistically?).

Thanks.

merlinofchaos’s picture

Status: Active » Fixed

Ok, with mini panels this is pretty much the most complex way to do it, though it has some nice benefits.

With a mini panel, in order to get information from the containing page to panes within the mini panel, you have to set a 'required context' on the contexts tab. Since your set up is using taxonomy terms, you'll want to set up two of them, one for city and one for state. That'll get the contexts into the mini panel.

How you get the contexts into the view varies a little. I'm going to detail my preferred method, because I think this is the easiest to maintain in the long term:

On your view, create a 'content pane' display. On the content pane display in Views there's a section named 'Pane settings'. Fill out the Admin title and Admin desc and Category so you can easily find the pane this view creates. Under Argument input, this will tell it how to match up data from the Panel to the View arguments (because they are very different structures, mapping is needed). Presumably you have one or two arguments in your view for Taxonomy: Term ID. Set the source for that/those to "From context" And set the source to "Taxonomy Term > Term ID". You can also use term name if you wish, but term IDs will perform better.

fblevins’s picture

I tried this with a test panel and it worked great! THANK YOU! I'll be implementing this sitewide (localhost) in the next couple of days and will give you and everyone documentation of what I did and how it turned out.

You're right about the mini-panels approach being about the most complex way to do what I'm doing, but right again that it has some features/options that you don't get with other approaches (without custom code). I hardcoded for 20+ years and CMS's (especially) like Drupal have given me a much needed break!

I remember when I was studying for my degree back in the 80's we had one course called "4th generation programming" that attempted what the modern CMS's are doing now and it was way cool, but just wasn't powerful enough. Now it is!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.