I realize there are ways to do this using multiple embedded views or view attachments, but I would like to the following in a single view display.

Created a list of nodes sorted by taxonomy term and labeled at the top of each section. So I would have something that looks like this:

TERM "A" HEADING
------------------------
link to node tagged with term A
link to node tagged with term A
link to node tagged with term A

TERM "B HEADING
-------------------------
link to node tagged with term B
link to node tagged with term B
link to node tagged with term B
link to node tagged with term B

Comments

merlinofchaos’s picture

Status: Active » Fixed

In the style settings look for the 'grouping' select box.

curagea’s picture

Status: Fixed » Active

I have the same question as the original poster, but when I tried the Grouping option, grouping by taxonomy term, it still lists my items as such:

TERM A
----------
Story 1

TERM A
----------
Story 2

TERM A
----------
Story 3

TERM A
----------
Story 4

TERM B
----------
Story 5

TERM B
----------
Story 6

etc...

It won't collapse them into:
TERM A
---------
Story 1
Story 2
Story 3
Story 4

TERM B
---------
Story 5
Story 6

davoso’s picture

In the style, select a format and then in the grouping field select: Taxonomy: Term.

Also, mark the "Exclude from display" checkbox in the field options of Taxonomy: Term.

curagea’s picture

That's exactly what I did. Still shows up that way.

Edit: Interesting... this occurs only if I'm logged in. Browsing as an anonymous user doesn't have this issue.

curagea’s picture

It looks like the Devel module's Theme Developer is messing up the layout. If I disable it, the grouping displays properly. Would this be a Views issue or a Devel issue?

merlinofchaos’s picture

Status: Active » Fixed

It is known that theme developer's markup can sometimes clash with module's markup. Sometimes there simply is no fix.

In general you should only use theme developer when you actively need it, and leave it off all other times.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

glennnz’s picture

Status: Closed (fixed) » Active

Hi

Sorry, gonna open this again.

I can't get this to work at all, the grouping is having no effect at all on the display of my block.

I have fields of node title of reference node (with CCK) and taxonomy term showing, with taxonomy term excluded from display.

Block style is a table, grouped by taxonomy term.

Node titles are just being displayed in date order, with no taxonomy headings showing at all. I'm assuming this is because my parent node has no taxonomy, I want to group by the taxonomy terms of the referenced node.

Cheers

Glenn

View export:

$view = new view;
$view->name = 'river_related_video';
$view->description = 'River video';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'River Related Video', 'default');
$handler->override_option('fields', array(
  'field_river_related_media_nid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'default',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_river_related_media_nid',
    'table' => 'node_data_field_river_related_media',
    'field' => 'field_river_related_media_nid',
    'relationship' => 'none',
  ),
  'name' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_taxonomy' => 0,
    'exclude' => 1,
    'id' => 'name',
    'table' => 'term_data',
    'field' => 'name',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'nid' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'node',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'action' => 0,
      'developer' => 0,
      'front' => 0,
      'news' => 0,
      'organisation' => 0,
      'page' => 0,
      'related_media' => 0,
      'river' => 0,
      'river_resident' => 0,
      'simplenews' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '5' => 0,
      '4' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'related_media' => 'related_media',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Related Media');
$handler->override_option('items_per_page', 5);
$handler->override_option('use_more', 1);
$handler->override_option('use_more_text', 'More');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => 'name',
  'override' => 0,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'field_river_related_media_nid' => 'field_river_related_media_nid',
    'name' => 'name',
  ),
  'info' => array(
    'field_river_related_media_nid' => array(
      'separator' => '',
    ),
    'name' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler->override_option('row_options', array(
  'inline' => array(
    'field_related_video_embed' => 'field_related_video_embed',
  ),
  'separator' => '',
));
$handler = $view->new_display('block', 'Block - Related Media', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
merlinofchaos’s picture

Status: Active » Fixed

With only 5 items per page you're probably not seeing much from the grouping. It might help to order by term first, and then date.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.