I'm sure I'm missing something, but I've tried several approaches and I'm stuck.

I want to use Panels to display a node type and include View panes that show other nodes that share the same taxonomy term.

I've tried following your helpful instructions in node view override, calling views with arguments, but I'm not able to get it to work.

Details:

* I set up a view with an argument of Taxonomy: Term ID; I added a Content Pane display; I set the Argument Input for that display to From Context / Id of top taxonomy term

* I used the system Panels page for /node/%node
* I created a variant with a selection rule for a particular node type
* In the Contexts section of that panel variant, I added a Relationship: Term from node
* I went to Content and added my views; I chose ID of Top Taxonomy Term in the Configure window, since I didn't see my Relationship appear there

I never seem to see anything that references the Relationship I've defined; all I ever see is the Context popup, which lets me select the Top Term - but that's not what I want. (The Top Term is - if I understand things correctly - from a different vocabulary.)

I've tried adding the views as Views and as View Panes; neither seems to work.

I've also tried changing my View and setting the Argument Input to different things (No argument, From Panel Argument, Argument Wildcard) but none of those seemed to work for me either.

I've tried passing @0 as the argument, even though the help text says that method may be removed.

I'm using

Panels 6.x-3.3
CTools 6.x-1.3
Drupal 6.15

Can you help me figure out what I'm missing and how I can use the Relationship I've defined in my panel variant to pass terms from the right vocabulary to my view?

Thank you VERY much!

Kristi

Comments

merlinofchaos’s picture

* I set up a view with an argument of Taxonomy: Term ID; I added a Content Pane display; I set the Argument Input for that display to From Context / Id of top taxonomy term

* I used the system Panels page for /node/%node
* I created a variant with a selection rule for a particular node type
* In the Contexts section of that panel variant, I added a Relationship: Term from node
* I went to Content and added my views; I chose ID of Top Taxonomy Term in the Configure window, since I didn't see my Relationship appear there

This sounds like exactly what you're supposed to do. I'm confused by the last bit:

What is Top Taxonomy Term? You don't reference it prior to this, so I'm not sure what it actually is. What is your relationship called? The relationship *should* appear there, so that part is just a little bit confusing.

merlinofchaos’s picture

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

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Because the issue queue has a great number of open issues, and there are few volunteers to tend them, I must prune old issues that are left untouched for a long time.
This issue has been marked "Postponed, needs info" for a long period, and is therefore closed. If this issue is still relevant to you, please feel free to re-open it.

killtheliterate’s picture

Version: 6.x-3.3 » 7.x-3.2

I'd be interested to see if there is any clarity for this issue, somewhere on the Internet. I believe my problem is similar to the op. Using Views, Panels, or Page Manager, whichever allows for this, I'd like to have a node view that is

a) contextually filtered via a term.
b) the vocabulary that the contextual term belongs to has a term ref field, arranged to ref another vocabulary
c) the nodes returned by the view are not referencing the contextual term, but instead, have been tagged with terms that the contextual term references

I think I've written that clearly enough... I began constructing this solely with Views, cloning the term view that comes with Views, and then adding a relationship. This, and a few variants, did not work, so I began trying to do this with Panels, though it seems that Panels is limited in the same way. I believe I'm just having a problem with the configuration, or a recipe for configuration, as it seems like this could be a common use case.

killtheliterate’s picture

Status: Closed (cannot reproduce) » Active

Sorry, meant to reopen this.

merlinofchaos’s picture

I'm not sure you can do #4 completely without a little bit of custom code, just because of the difficulty of duplicate rows being returned by the view.

Your relationships are relatively straightforward. You've got term A (the argument term) with a term reference to terms B.

The trouble is that what you probably want to have multiple terms that you pass to Views in an argument. However, the only code that currently allows for that is restricted to nodes. That's actually an oversight from the D6 upgrade. In order for this to work, the relationship 'terms_from_node' needs to be replaced with a generic 'terms from termreference' probably that can create a multiple term context and then pass that to Views using the 1+2+3+4 format so that you can filter nodes via multiple terms.

Other than THAT problem you can do it, but it will require some dev work.

killtheliterate’s picture

How should I begin to create the "terms from term reference" relationship in Views? I read that to mean that it currently doesn't exist.

I've tried to use a few views hooks in order to pass multiple arguments based on a single argument? Is that a direction worth pursuing? I noticed that hook_views_query_alter() didn't seem to do it, though I could see my new args reflected in a dpm of the $view.

merlinofchaos’s picture

You would probably want to start with the existing ctools/plugins/relationships/term_from_node.inc and try to retool it so that it can work on any entity, not just a node. That could easily be submitted as a patch.

killtheliterate’s picture

Thanks! I'll take a look. Hopefully I can put together something worth contributing to your extremely awesome project.

merlinofchaos’s picture

Feel free to ask me for advice on it, I'm happy to help contribution!

killtheliterate’s picture

I guess my most immediate question would be if there is already a handler for, in regards to an entity like a term:
'context' => 'ctools_terms_from_node_context',

Or is this the missing piece? I saw in the queue someone asking a similar question, but it was old, and didn't have an answer, really. Is it the 'context' piece that is missing, or just an implementation of it as a ctools plugin?

merlinofchaos’s picture

What's missing is that the 'required context' section of that plugin requres a 'node' context. You would want to switch that to being an 'entity', and then making sure the function referenced that accepts the source context and produces the related context can handle the fact that it is now a generic entity, not just a node.

You can look at one of the entity relationships to see how we handle some of the generics when dealing with unknown entities.