I'm not quite sure which queue is appropriate, Views or CTools. Either way, a contextual argument requested by a "Context Display", or "View Pane" view ("Input on Pane Config") isn't converting tokens into values as expected.
This seems to be irrelevant of whether the contextual argument (in the view) is set to "Global: NULL" or any other argument type.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Can you be more specific? If it's not doing what's expected, what is it actually doing?

Can you give me a scenario I can use to reproduce this?

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
Itangalo’s picture

Status: Postponed (maintainer needs more info) » Active

The thing that is needed is that "input on pane config", as provided by Views Content Panes, process keywords. This would allow using all sorts of data as arguments in view content panes – not only the ones provided as "natural" tokens.

I'm gonna have a stab at providing this for 6.x, since I need it right now in a project. Hope to be back within a reasonable time span.

Itangalo’s picture

Attached is a patch for D6. I haven't looked at the D7 code for Views Content Panes, but I'm pretty sure it can be replicated more or less straight off.

Sorry for a patch that isn't made in the (new) pach workflow, and sorry for submitting a patch for D6 rather than D7. I'm a bit short on time right now. Hope to be back with a more proper patch.

Views Content Panes is the shit.

jastraat’s picture

FileSize
1011 bytes

I'm attaching a re-roll of this patch for Drupal 7, but when I tried to test it, it didn't appear to allow tokens in the 'input on pane config' for view panes.

merlinofchaos’s picture

I still don't understand this patch, because I don't understand the scenario that's triggering the problem.

Itangalo’s picture

@merlinofchaos:
The scenario is that you want a (CCK) field value as an argument in Views, for example when sending field_city as an argument to let Views list everyone on the same street. Currently Views Content Panes has no way of accepting this.
The workaround is to select argument input method as "input on pane config" and then enter something like %node:field_something-value (for D6). However, this requires that the string sent as argument is evaluated with keyword replacements – which is not the case (unless you apply something like the patch above).

(Ideally you would not use "input on pane config" as argument input method in the example above, but instead "from context" and provide the CCK field as a possible data from a node object. But running keyword replacements on the string from "input on pane config" is still a valid use case, since you might want to do simple string manipulation before sending the argument to Views – like changing "%node:field_twittername-raw" into "@%node:field_twittername-raw".)

merlinofchaos’s picture

Category: bug » feature
Status: Active » Patch (to be ported)

I see. And I'm thinking we don't currently have proper token replacements for fields because that functionality is actually broken in core.

If we did, they would show up as keywords that you can use as 'from context'. As for the string manipulation, that is an interesting use case. I suppose I can accept that.

We're going to call this a feature request. Committed to D7.

This probably should be backported to D6.

amateescu’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Needs review
FileSize
1.11 KB

Re-rolled for D6.

Itangalo’s picture

Wohoo! This will increase the power of contextual filters + Views Content Panes a lot.
Good news.

coleman.sean.c’s picture

Tested the patch from #9, which doesn't seem to work. Do I have the use-case right?

1) Clean drupal install, download and enable token, content, text, panels, views, views_content, views_ui and page_manager, apply patch.

2) Add a plaintext field to the Page content type, field_foo.
3) Create some Page nodes, with content bar in the foo field.

4) Create a view with a Context display and node row-style, that returns 1 node of type Page.
5) Create a view with a Content Pane and node row-style, that takes field_foo as an argument and returns 1 node, set the argument input type to 'Input on Pane Config'.

6) Create a panel page, using the view from 4 as a Context and Node From View as a Relationship.
7) Add a custom content pane that just displays %node:field_foo-raw
8) Add a view pane of the view from 5, that takes bar as an argument.

9) Add a view pane of the view from 5, that takes %node:field_foo-raw as an argument.

The pane from 7 displays properly, so the keyword replacement works. The pane from 8 displays properly, so the view works when it is given an argument. The pane from 9 does not display, so the arguments aren't getting keyword-replaced before they are fed into Views.

This would be an extremely powerful addition to the Context-Views-Panels package, if we could get it working.

Itangalo’s picture

Status: Needs review » Needs work

@coleman: Yep, you got the use case right. (You don't have to loade the node context by a Views context display, but that's one way of doing it.)

And yes, it would be really powerful.

  • merlinofchaos committed 0eefae0 on 8.x-2.x
    Issue #1137696 by Itangalo: Allow keyword substitutions on "Input from...

  • merlinofchaos committed 0eefae0 on 8.x-3.x
    Issue #1137696 by Itangalo: Allow keyword substitutions on "Input from...