This is related to Issue: http://drupal.org/node/1195704
To recreate follow the instructions from the issue above with one change: Add as view pane
Setup your view with a 'content pane' display and your contextual filter. Test with the preview functionality to make sure it's working.
- Configure PANE SETTINGS > Argument input:Edit > From context
- Go to your panel and setup the context by adding the relationship for Multiple terms from node
- Add your view into the panel as a view pane
- In the view settings on the panel pane, there are no options under context.
Since panels is smart generally about filtering out content pane displays from being options under views, this means that we can't pass taxonomy term arguments through any of the views panes we created....
Comments
Comment #1
merlinofchaos commentedWhen you create a view as a content pane, it isn't added in the ordinary manner for a view (which is a difficult UI to use) where you first select the view, and then select the display. Instead it's promoted to a full CTools content type and added independently. Moreso, if using "From context" if you are somehow not getting the contexts ot match up properly, you can actually have it not show at all since if it thinks there isn't a valid context for the view, it won't show.
Be sure to look under the "Views panes" category (or whatever category you named it in the display config) rather than in the 'Views' category. If you're going through a modal where the first thing you do is select the view display, that will not allow you to use a content pane and you cannot use contexts with that interface.
Comment #2
jastraat commentedMerlin, I'm sorry if I was unclear, but I am using entirely view panes. Been working exclusively with view panes (content panes in views lingo) for months now.
It does not appear to be possible to pass multiple terms from node as context to a view if the view is a content pane.
The context (in the panels configuration) is available if the view is added to panels as a 'view' (I understand that content pane displays do not appear as options with this method.) but the context is not available if the view is added as a 'view pane'.
Very simply, I want to be able to pass the taxonomy terms from the node being viewed as an argument to a view within the panel display to return other content with those terms. It may also be worth mentioning that this context needs to be optional; if the node being displayed has no terms, I want to display all possible results.
My view content panes work: tested with arguments in the preview pane.
They take arguments from context with the required context being Term ID. (with optional checked)
I've tried two different relationships in the node template page to get the node's terms:
Term from node => currently produces a PHP error: Notice: Undefined index: entity_taxonomy:term in ctools_get_plugins()
Multiple terms from node => no error, but no option under "Taxonomy term: Term ID" in the view pane settings
With the 2nd relationship (multiple terms), I do get "Term ID of all term, separated by + or ," as a context option in the view settings - but only if I add the view as a view and not as a view pane. When added as a view, the context does successfully limit the view results to those nodes tagged with matching terms.
I know the view panes are a bit smarter about showing available contexts in the view settings, so my guess is that the validation is just a bit too strict right now.
Here's a simple views export with only one display, a content pane:
Here's a simple export of the node template pane variation with the view added in two ways:
Edit: Add PHP tags for readability.
Comment #3
jastraat commentedComment #4
merlinofchaos commentedOk, there were two minor issues causing this.
1) The multiple terms context wasn't available to Views. This is the important one; your view is set to receive a single term context, and that's fine, but not what you want. The multiple terms context wasn't available to Views. I committed a fix.
2) The multiple terms context was not behaving as a single term, which it is absolutely supposed to be able to do. I committed a fix for this at the same time.
Comment #5
jastraat commentedWonderful! Thank you :)
Update: just to confirm - that fixed the problem I was having.