Using the latest dev (Nov 7), and matched with Views and CTools dev releases...

I can't get a %term to be passed from the node being viewed through to a Views pane.

The %term is being expanded in the panel page fine (ie, if I add it to a new content fragment, it is displayed int he final rendered page.

The value of the %term properly calls the view pane (ie, if I manually input the term on the panel argument input, the rendered page pulls in the view pane as expected)

So the gap is between the Panel page and the View Pane. Here's what I have:
----
NODE (target)
The target nodes are a content type fitted with a CCK-taxonomy field, set so that taxonomy values are being saved onto the node.

So I can see the term name sitting in the node at: taxonomy:array:object:name

VIEW
The view is filtering for this content type
There is one argument: taxonomy term
If I feed the term value into the preview, we get expected results.

How to collect an argument from the panel pane?

PANEL PAGE

The view pane is being displayed alongside a node whose content type includes the same CCK-taxonomy field, also set to save values to the node. So I can also see the the term name sitting at: taxonomy:array:object:name

The node is displayed through Panels node template (node/%node)

I want Panels to pull the taxonomy term name out of the node being viewed, and pass that as an argument to the View.

So I have tried everything I could think of, including:

- Context: node being viewed>vocabulary>limit to the vocab of interest (taxKey)
- Relationship: term from node being viewed (relokey)

The value of the relationship term is displayed as expected on the node panel, but it is not being passed to the Views Pane as an argument...

Attached is the node_panel export and the view_pane export.

Any insight very gratefully received.

CommentFileSizeAuthor
views_pane.txt31.38 KBboabjohn
node_panel.txt8.77 KBboabjohn

Comments

codekarate’s picture

I am also experiencing a similar problem. I am having difficulty passing arguments from a panel page to a view pane. I have tried pretty much everything I can think of, but I am obviously missing something.

I am just trying to get a view pane to show up on a panel's overridden node edit page (blog entry node). For example, on each blog entry I want to display a small view for listing the authors other related posts. The view is simple and just accepts a uid from the author of the node. If I manually put in a UID it works great but I can't seem to make it dynamic.

I tried passing in the correct %keyword for node author in the views pane argument but it does not work (the same issue listed above).

Thanks for any help in advance.

codekarate’s picture

I did some more research and found this issue where it states that views content panes do not accept arguments the same way that a normal view does. In my situation that means I will convert my views content panes over to be views blocks so I have more control over the arguments on the panel side of things. The other option is to specify default arguments in the view itself.

http://drupal.org/node/683704

wonder95’s picture

After wrestling with this for a while, I can verify that there are issues passing contexts from Panels pages to Views content panes. In my case, I was using the default taxonomy term page with Views content panes, using Term ID as the argument. In the Argument input settings in the pane config, I have selected:

  • Taxonomy: Term ID source = From context
  • Required Context = Term ID of first term (also tried just Term ID)

However, I was getting no content. I then added custom content pane with just a value of %term:id as content to make sure it was there, and it was displayed just fine, so I knew the value was there. Finally, I changed the settings for the Term ID argument to use a default value of "Taxonomy Term ID from URL", and it started working.

This indicates to me that the context value is not getting passed to the content pane, because the default value is only supposed to be used if there is no argument (it falls under "Action to take if argument is not present" in the argument configuration). However, in this case, there was a valid argument (as demonstrated above with the custom content), so the default argument should not be necessary.

So, it seems that with passing parameters to Views (at least taxonomy terms), the only options are to:

  1. Use a block display so the passed argument can be controlled from the panel config (which seems to pass the argument correctly), or
  2. Set a default value for the argument to pull from the URL

unless I'm not understanding how context values are supposed to be passed to content panes.

capellic’s picture

Same problem here. In my case I am trying to pass %node:nid into my Panel Panel view display. I ended up proving a default value, "Content ID from URL". Would be great to have this fixed because, depending on where I am including the view, the NID shows up in a different place in the URL and so this solution isn't great. I ended up having to create two different view displays.

weekev’s picture

+1 Confirming same issue, passing %keywords via pane input to content panes isn't working.

dan.d’s picture

+1 Same thing (D7 P3)

merlinofchaos’s picture

Status: Active » Closed (works as designed)

Views does not (and never has) supported token substitution when passing arguments to Views.

The only way passing context information is supported to Views is to 1) use a Content Pane display and 2) set the arguments to "From Context", and then 3) Select the type of argument to retrieve from the context.

In D7 there was recently a problem with the system getting confused about the transition of taxonomies to entities, but in D6 I know this is working.

dan.d’s picture

Merlin,
Thanks for your response. In my case I was using Content Pane displays and "input on pane config" as my argument input. Which seemed to be the right thing to do, considering what I was planning for the Panels' side.

On the Panels' side I've created a Relationships within Contexts. Which gave me some extra variables that I wanted to pass to my Views. (To be exact, I was working with a Node template and created a relationship of type Taxonomy term from Node (on Node: City), city is a vocabulary of terms.)

As I proceeded to adding my Content Pane display (well tested prior) to the panels, I added the View pane that I previously created. When the Settings pop-up opened with the title "Configure new View: [ViewName]", there was a text field with the following description: "You may use keywords for substitution". And so I did. I used %taxonomy_term:tid.

I went on with testing the display... And it didn't bring the expected results. I tried to replace the token with the numeral fixed value, it worked as expected.

At that point I started wondering whether I made a mistake while creating the Relationship or whether I overlooked some little detail. So, I decided to go over and simplify both the View and the Contexts of my Node template. I pulled the token from the list of Node-allocated keywords. I made a simple Content Pane in Views that was less restrictive (if at all). I couldn't get it to work.

So, if you ask me. It seems like the View deals well with getting the arguments from the Node template. However, keyword substitution doesn't happen. If that was done intentionally, then perhaps the message "You may use keywords for substitution" could be removed.

I appreciate all your work and contributions, as well as the time you take to explain things and answer our questions!

Dan

merlinofchaos’s picture

Oh, I'm wrong.

      case 'user':
        $args[] = (isset($conf['arguments'][$id])  && $conf['arguments'][$id] !== '') ? ctools_context_keyword_substitute($conf['arguments'][$id], array(), $contexts) : NULL;
        break;

It *does* support keyword substitutions there. Color me surprised, I apparently don't even remember how my own code works. Sigh.

So, I don't see why that wouldn't be working. :/

dan.d’s picture

I'm glad to know that this option is available. I'll try it with a fresh install and let you know if I get it to work.

A bit off subject... I just noticed there's a conflict with some of the modules installed on my test server (I suspect one of the Devel mods). It conflicts with the view of Panel Pages (/structure/pages) and messes up the "exposed filters in a block" feature. Is there a reference of conflicting modules anywhere on the web?

Thanks!

tobias.grasse’s picture

Same here with Panels 7.x-3.0 alpha3 and Views 7.x-3.0-rc1:

Configuration:
* Panels has Relationships for All Tags from Node
* View Pane is configured to send NID and Tag Taxo IDs to the View
* View has Contextual Filters to sort out the NID which gets passed (cause I don't want to show its teaser on the right when I'm viewing the full node) and to filter for nodes who have the same Tag Taxo IDs (cause they're probably related).

If I insert explicit NID and Term IDs on the View Pane Panel config, everything works as expected. When I try to make it dynamic using %keyword, the view doesn't show up at all, even if it's configured to show a "no results found". Unfortunately, I can't find a way to debug if the keyword actually gets passed to the View, or if Panels kills it before even sending it.

tpopham’s picture

tpopham’s picture

I got it narrowed to an insufficiently robust ctools_content_select_context() filter. The function doesn't anticipate arguments, and so in the absence of context configuration data, the render method doesn't get any data to substitute for the keywords. I'm just going to branch the logic inside the function to handle the possible alternative. Maybe the configuration should be augmented with a `context' keyed array mirrroring the `argument' (sic?) keyed array earlier in the pipeline, though? (oops, wrong issue)