The site I'm developing has a taxonomy environment in which nodes are assigned multiple terms in a single vocabulary.
When I create a view using the Taxonomy Term ID as the argument, and specify a single Term ID as the argument value (filtering to limit the results to the appropriate vocabulary), I get a list in which each node that matches the specified Term ID appears NOT ONCE -- but a number of times that matches the total number of number of taxonomy terms assigned to it. (This happens with the depth value set to 1.)
By contrast, When I create a view using the taxonomy term NAME as the argument and the same filter, I get the desired result -- each node matching the Term ID appears just once.
If I could simply use the term name, I'd do that, but I want to use this view in a setting that will combine two views and Panels Taxonomy on a single page. And Panels Taxonomy only works with Term ID, not Term Name, as the argument passed by the Panel's URL.
This looks to me like a bug in Views (since it occurs in the view itself viewed independently of the other elements of the page), and at the moment I'm stumped about how to proceed.
I'm using Views 5.x-1.6, Panels 5.x-2.0-alpha7 and Panels Taxonomy 5.x-0.5.
Thanks for any help!
An export of the Taxonomy Term ID version of the view follows:
$view = new stdClass();
$view->name = 'mktpl_cat_view';
$view->description = 'A block to create marketplace category listing pages';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = '';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'cat/marketplace';
$view->use_pager = FALSE;
$view->nodes_per_page = '500';
$view->menu = TRUE;
$view->menu_title = 'Marketplace category';
$view->menu_tab = FALSE;
$view->menu_tab_weight = '0';
$view->menu_tab_default = FALSE;
$view->menu_tab_default_parent = NULL;
$view->menu_tab_default_parent_type = 'tab';
$view->menu_parent_tab_weight = '0';
$view->menu_parent_title = '';
$view->sort = array (
array (
'tablename' => 'node',
'field' => 'nid',
'sortorder' => 'ASC',
'options' => '',
),
);
$view->argument = array (
array (
'type' => 'taxid',
'argdefault' => '1',
'title' => '',
'options' => '-1',
'wildcard' => '',
'wildcard_substitution' => '',
),
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node_data_field_phone',
'field' => 'field_phone_value',
'label' => '',
'handler' => 'content_views_field_handler_group',
'options' => 'default',
),
array (
'tablename' => 'location',
'field' => 'street',
'label' => '',
),
array (
'tablename' => 'location',
'field' => 'city',
'label' => '',
),
array (
'tablename' => 'location',
'field' => 'province',
'label' => '',
),
);
$view->filter = array (
array (
'tablename' => 'term_data',
'field' => 'vid',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => '18',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_phone, location, term_data);
$views[$view->name] = $view;
Comments
Comment #1
merlinofchaos commentedAdd Node: Distinct to your filters.
Comment #2
Bill Smith commentedCool!
I was stumbling around looking for something like "Nodes: Once only" ... Never would have guessed that "Nodes: Distinct" was the fix.
Thanks much!
Comment #3
(not verified) commented