Hi,
I am looking for a solution to be able to filter results from a view based on the $argument in the url.
The $argument in the url will be the termname.
Say www.example.com/view_name/Nepal <== Nepal being termname for say Term ID of 10
Can I use your module to build php to filter the view to nodes only tagged with the term Nepal.

I thought of something along the lines of:

/ Show only filtered taxonomy term through $argument
if ($argument) {
  $tmpterms_0 = taxonomy_get_term_by_name($argument);
  $view->display_handler->override_option('term_node_tid_depth' array(
     'value' => $tmpterms_0[0]->tid,
     ));
  }
return TRUE;

Thanks a lot in advance!
greetings, Martijn

Comments

gnassar’s picture

I guess. But why wouldn't you just put in a term argument into the View? I don't see why this needs to be done with the PHP filter.

But sure, if you wanted to, that's possible. I try not to troubleshoot peoples' individual PHP code in the issue queue, though. That's dependent on your site, and can't be handled here.

gnassar’s picture

Status: Active » Closed (fixed)