It would be great if this module could provide a Panels relationship for a context, so that within the panels system, the node for a term could be accessed with keywords etc, and likewise, the term for a node.

I've added a patch that adds the hook for panels to pick up plugins on for taxonomynode.module, and the plugin files within a zip. The plugin files would need to go in directories as follows:

taxonomynode/panels/relationships/taxonomynode_node_from_term.inc
taxonomynode/panels/relationships/taxonomynode_term_from_node.inc

As I can't add files to the module in a patch, I hope this is a satisfactory way of supplying them.

Comments

neilnz’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new4.84 KB

Tested this patch out and it works as advertised.

I tested it using a relationship to node context passed to an argument in a view.

I've rerolled the patch as a single file (patches can indeed create files!), but haven't modified the code.

It might be more technically correct for the directory to be named "plugins" rather than "panels", as ctools stuff isn't exclusively panels (although I agree 99% of the time it is). It's more common for ctools plugins to live in a "plugins" dir.

An alternative method that also works is my patch #1020872: Token support that simply adds a token. The patch on this issue is a more sophisticated way to solve the panels problem, but there's still merit in both patches being committed.

Toxid’s picture

I'm trying to add a comment listing to my terms. This module and panels seems to be a good way to do that, letting the node hold the comments and load them and the comment form through panels on the term page. I couldn't get the second, combined patch from nielnz to apply, but the first one did. At first glance it seems to work, but when I add the comment form and listing in panels, all I see on the term page is "Comment form here." and "Node comments go here.". I can't figure out what's wrong here, any ideas?

james.williams’s picture

@Toxoid - have you set the context correctly on your comment pane? I think you need to set where it should pick the node up from -- perhaps it is not pulling in the node from the right context. It looks like 'Node comments go here' is displayed when the node is not defined.

Toxid’s picture

@james.williams - On the comments pane there's only one option for the node setting: "Node from term (Taxonomy Node)", which seems right.

The only thing I've done really is taking the default term page override in panels and added Node from term relationship. Then I added a view for the terms and a comment pane in the panel content. I'm pretty sure there's some detail I'm missing out on.

james.williams’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new4.84 KB

Ah... the patch doesn't work - goodness knows how that crept in - It was checking the UID instead of the TID!

Attached patch is a fixed version of the patch in comment #1.

Toxid’s picture

Status: Needs review » Reviewed & tested by the community

Ah, well it's easy to miss such a small thing. Now it works! The comments show up just as expected. Good job, a very useful addition to this module indeed.