Unable to filter by term
newswatch - July 4, 2009 - 12:13
| Project: | Views |
| Version: | 5.x-1.6 |
| Component: | taxonomy data |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
I am creating a view which will show the most popular items of any term. The boock thus created will appear in all term pages. So viewing the term page A will show a block with the most read items of that specific term.
The view that I am creating is showing the block all right, but has nodes of all content types and terms. I have set the argument handling as taxonomy: term ID with Option=1 and wildcard=%tid.
The Views code generated is as under:
$view = new stdClass();
$view->name = 'topstories';
$view->description = '';
$view->access = array (
);
$view->view_args_php = '';
$view->page = FALSE;
$view->page_title = '';
$view->page_header = '';
$view->page_header_format = '3';
$view->page_footer = '';
$view->page_footer_format = '3';
$view->page_empty = '';
$view->page_empty_format = '3';
$view->page_type = 'node';
$view->url = '';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->block = TRUE;
$view->block_title = '';
$view->block_header = '';
$view->block_header_format = '3';
$view->block_footer = '';
$view->block_footer_format = '3';
$view->block_empty = '';
$view->block_empty_format = '3';
$view->block_type = 'list';
$view->nodes_per_block = '10';
$view->block_more = FALSE;
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array (
array (
'tablename' => 'node_counter',
'field' => 'totalcount',
'sortorder' => 'DESC',
'options' => '',
),
);
$view->argument = array (
array (
'type' => 'taxid',
'argdefault' => '2',
'title' => 'Headline',
'options' => '1',
'wildcard' => '%tid',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
);
$view->filter = array (
);
$view->exposed_filter = array (
);
$view->requires = array(node_counter, node);
$views[$view->name] = $view;Any push towards the right direction will be greatly appreciated :)
Subir
