Closed (fixed)
Project:
Views default argument from Context
Version:
6.x-1.2
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 May 2010 at 05:07 UTC
Updated:
10 Jul 2010 at 23:23 UTC
Comments
Comment #1
brynbellomy commentedI believe that the taxonomy array on a $node object is keyed by tid, so you'd probably have to do something like:
$terms = array_values($node->taxonomy);
context_set('node', 'tid', $terms[0]);
or perhaps
$first = reset($node->taxonomy);
context_set('node', 'tid', $first);
... this is assuming that taxonomy builds the array so that lowest weighted terms (and highest terms in the tree) are at the front of the array. In any case, tell me if you have any luck with this.
Comment #2
Adam S commentedThank you.
Comment #3
brynbellomy commentedOh, you know what? I forgot -- you can't context_set an object. Serialize the objects and you're fine, though. Change the above code to:
and
Comment #5
hixster commentedsubscribing