I need to create a view block where users who have entered a specific tag are displayed. I have the page set and it works properly. I just need to know how to set up the default argument based on context when associating that specific tag. How would I set up the namespace and attribute if it were for a tag (given the nature of tagging where a new user may not have entered it until they create a profile or content)

Comments

SunRhythms’s picture

I need a helper module or any other method possible of forming my context on a user profile that has a particular taxonomy term reference field. I am doing this because I need to generate a block of users that share common taxonomy terms within the vocabulary. I think it is similar to the Default Argument from Context Module's .module file the code below found at the bottom. Unfortunately, I don't know how to use it or rewrite it because its the only one without the context_set('namespace','attribute); so I can't just plug it into the views UI "provide a default argument" _ "context" section.

function views_arg_content_node_get_terms($node, $key = 'tid') {
static $terms;
if (!isset($terms[$node->vid][$key])) {
$query = db_select('taxonomy_index', 'r');
$t_alias = $query->join('taxonomy_term_data', 't', 'r.tid = t.tid');
$v_alias = $query->join('taxonomy_vocabulary', 'v', 't.vid = v.vid');
$query->fields( $t_alias );
$query->condition("r.nid", $node->nid);
$result = $query->execute();
$terms[$node->vid][$key] = array();
foreach ($result as $term) {
$terms[$node->vid][$key][$term->$key] = $term;
}
}
return $terms[$node->vid][$key];
}

Can you help me rewrite the code and usage namespace and attribute determination for my needs? Thank you in advance.