By adding in a Nat TID relationship I am able to create a view with an exposed Taxonomy Term filter dropdown list. Without this addition I was only able to expose a tid textarea in my view. Please look at the attached image of the views admin interface which will make much more since of what I am accomplishing with this approach.

I'll attach my patch in the next post, if there is a better way of doing this, I hope this will spur something good.
great module, thanks.
SY.

Comments

syakely’s picture

StatusFileSize
new483 bytes

patch is just the addition of four lines to nat.views.inc

$data['tan']['tid'] = array(
    'title' => t('Tid'),
    'help' => t('The tid of the NAT term.'),
    'argument' => array(
      'handler' => 'views_handler_argument_term_node_tid',
      'name field' => 'title',
      'numeric' => TRUE,
      'validate type' => 'tid',
    ),
    'filter' => array(
      'handler' => 'views_handler_filter_numeric',
    ),
    'relationship' => array(
      'base' => 'term_data',
      'field' => 'tid',
      'label' => t('NAT Tid'),
    ),
  );
stefan81’s picture

subscribe

stefan81’s picture

Hello syakely,
Your contribution saved my day! Thank you very much.

I tested it: works!
Also the argument relations work,
but with one bug:

The argument "Taxonomy: Term ID" shows up twice.
- One can use relationships (only NAT: Tid)
- One can not.

Others like "Taxonomy: Parent term" work fine.

stefan81’s picture

Status: Active » Reviewed & tested by the community

Hi, I installed 6.x-1.x-dev (2010-Nov-16) and added this patch again.
Works like a charm!
It is a simple but great functionality!
Why don't you add this to the next release?

aaron’s picture

good one! another useful addition would be the NAT tid field, as below:

    'field' => array(
      'handler' => 'views_handler_field_taxonomy',
      'click sortable' => TRUE
    ),
aaron’s picture

and here's the patch for that...

aaron’s picture

StatusFileSize
new914 bytes

another try

aaron’s picture

StatusFileSize
new914 bytes

another try