This patch adds CTools context support (and so Panels support as well). Specifically, it adds a context relationship: if you already have a valid node context, you can get it's related primary term context on the context configuration page.

CommentFileSizeAuthor
primary-term-ctools.patch2.26 KBdrifter

Comments

sethcohn’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

I'll be testing this, and ask for others to review as well, the more eyeballs/testers the better.

merlinofchaos’s picture

+  'defaults' => array('vid' => ''),

No point in having defaults if the relationship has no form and thus no values of its own to store.

+  if (isset($context->data->primary_term)) {
+    return ctools_context_create('term', $context->data->primary_term);
+  }

Is it possible for this to not be set? If so, this returns nothing. Would be best (I have recently learned) if it returned an empty context in this case. (This is one place where following CTools examples won't be right, since I have only recently learned this).

Otherwise this is simple and looks good.

brianV’s picture

Status: Needs review » Fixed

Changes made as suggested by merlinofchaos, and committed:

http://drupal.org/cvs?commit=435668

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.