Hi,

I have a cck type called 'movie' that lets you choose a category based on taxonomy. The category is a multiple select, so when I choose more than one category the row is duplicated in my views page. So what I want to do is group my results by the field title so I don't get duplicate rows. Have found a few pages on this problem but still cannot seem to get it to work. Below is an export of my view. I have tried using the theming wizard using a grouped list as my theme type.

$view = new stdClass();
$view->name = 'movies';
$view->description = 'Listing of all movies';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Movies';
$view->page_header = ' listing_category(\'movie\'); ';
$view->page_header_format = '2';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'list';
$view->url = 'movies';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->menu = TRUE;
$view->menu_title = 'Movie';
$view->menu_tab = FALSE;
$view->menu_tab_default = FALSE;
$view->menu_tab_weight = '-5';

$view->sort = array (
array (
'tablename' => 'node',
'field' => 'created',
'sortorder' => 'DESC',
'options' => 'normal',
),
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'nid',
'label' => '',
),
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'link',
),
array (
'tablename' => 'node',
'field' => 'link',
'label' => '',
),
array (
'tablename' => 'users',
'field' => 'name',
'label' => '',
),
array (
'tablename' => 'node',
'field' => 'created',
'label' => '',
'handler' => 'views_handler_field_date_small',
),
array (
'tablename' => 'node_data_field_version',
'field' => 'field_version_value',
'label' => '',
'handler' => 'content_views_field_handler_group',
'options' => 'default',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'term_data',
'field' => 'vid',
'operator' => 'AND',
'options' => '',
'value' => array (
0 => '2',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, users, node_data_field_version, term_data);
$views[$view->name] = $view;

Comments

evo’s picture

Ignore the php warning for the page header. I am just calling a function to list my categories.

mooffie’s picture

The category is a multiple select, so when I choose more than one category the row is duplicated in my views page. So what I want to [...]

Have you tried using the 'Node: Distinct' filter? It's in the 'Filters' box.

evo’s picture

Yes just tried it and it worked perfectly. Can't believe it was hidden away like that.

Thanks heaps.