Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
7.x-1.x-dev
Component:
Plugins system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Jun 2011 at 20:45 UTC
Updated:
2 Aug 2011 at 16:11 UTC
Use case: want to get the terms associated with the node being viewed and pass the list to a view content pane to get other nodes with those same terms.
"Multiple terms from node" is supposed to generate a keyword context "%terms"
%terms:tids --> Term ID of all term, separated by + or ,
(which would be ideal for passing to a view content pane as an argument)
However - %terms:tids is empty - as are all the other displayed permutations of %terms
Confirmed this by trying to use the context keyword in both the page title and in a custom content pane.
Comments
Comment #1
Flommy commentedHaving issues with this too, subs
Comment #2
rickmanelius commentedIt's also an issue in the latest dev.
And to clarify. It's not that %terms:tids is empty. If you output it as the page title. It'll work (e.g. I get 78+98+99 for a particular node). It's when this is passed to the views content pane that it doesn't work. However, if instead of %terms:tids I paste in its output of 78+98+99, then it works.
In short: %terms:tids will output data when used as a panel title, but these values are not getting passed through for a views content pane. I'm assuming this is ctools related versus panels or views as both panels and views will work when a manual string is used.
Comment #3
rickmanelius commentedPS. If there is a link that has tips on how to best debug ctools overlays, I'll gladly give this a whirl myself. But I haven't had enough time to really learn this system yet, so I don't know where a good starting point would be.
Comment #4
merlinofchaos commentedIn this case, plugins/contexts/terms.inc -- there's the 'convert' and 'convert list' keys that point to functions.
Comment #5
merlinofchaos commentedWait, how are you passing %terms:tids to the content pane?
Comment #6
rickmanelius commentedHey merlin.
I pray that this is not user error (based on your last comment) and that I might be doing something stupid.
My view is a content pane with a context filter accepting term id's.
The argument in the view is being sent by "Input on pane config"
In the panel context tab, I'm using the relationship to "Multiple terms from node"
Now in the panel, I'm adding the view content pane in. I then add the term id through "Content has term ID." If I manually sent (e.g. 78 representing 'drupal') it works. But if I pass %terms:tids instead, nothing appears. I know %terms:tids represents 78 because if I output it as a title, I can see 78.
I'm debugging using the pointers you suggested in #4. So far, I'm thinking the ctools_context_keyword_substitute is not getting the correct information sent to it, but I haven't been able to confirm it yet.
Thanks for the followups. I appreciate it. If it's user error, I'll kindly close the thread. Otherwise, I'll keep debugging using the suggestions above.
Comment #7
rickmanelius commentedUsing devel's dpm function, it seems like %terms:tids is not being replaced for the "Content has term ID" field, but again, it replaces just fine in the panel title.
Comment #8
merlinofchaos commentedYou should use 'From context' instead, and then select the tids from multiple terms. Then you can pass the context right through and not try to input on pane config.
I don't think that the "input on pane config" does context substitutions.
Comment #9
rickmanelius commentedFixed!
For those finding this thread later: the method is using #8 by merlinofchaos. Here are the more detailed instructions.
- 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 (don't worry that it's not a view pane... I got tripped up here)
- In the view settings, send the "Term IDs of all terms" or whatever is appropriate to your goal
I can clarify this more, but this should get you going because this is what fixed this issue for me.
Although you might assume you can do the same thing using the "Input on pane config" option, the text subsitutions don't work here and that might confuse you (as it did for me). So don't use that option :)
Comment #10
jastraat commentedWhat did you use as the "Required context" in the argument input under pane settings? I've tried to use Term ID, but in panels, I only see "no context" as an option.
Comment #11
jastraat commentedSo the problem appears to be that the context options on views only appear if you add the view as a view and not if you add as a view pane. This wouldn't be a terrible tragedy except that only the master display is available if adding a view directly to a panel layout. I'm going to open up a separate issue for that.