I have a content type with two different text fields, let's call them Type and Color.

I want a view of this node type that accepts Type and Color as arguments. I can create the view and accept the arguments without any trouble, seeing for example browse/Mazda/red or browse/Toyota/white.

I would like an Attachment to show summaries of the arguments: Honda (9), Mazda (4), Toyota (3) AND Blue (4), Red (10), White (2).

I would like these argument summaries to allow navigation of the view and its arguments on both levels. I would like both argument summaries to display at all times.

I tried two tacts, both unsuccessful:

  1. Create two different attachments, one for each argument. Unfortunately, each attachment tried to affect arg(1) instead of the proper argument for that field. In other words, this did not work for hierarchical browsing.
  2. Create two argument summaries within the same attachment. Unfortunately, the attachment only displays the first argument summary and never the second.

I would like to do this using CCK fields and NOT taxonomies.

Am I missing something obvious? Is there another approach to take?

Here is my views export:

$view = new view;
$view->name = 'listings';
$view->description = 'Browse Firm Listings';
$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', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => 'Firm Name',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'field_financing_organization_value' => array(
    'label' => 'Types',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'custom',
    'format' => 'default',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_financing_organization_value',
    'table' => 'node_data_field_financing_organization',
    'field' => 'field_financing_organization_value',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'field_financing_function_value' => array(
    'label' => 'Financing Functions',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => 'listings/financing-function/[field_financing_function_value]',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'custom',
    'format' => 'default',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_financing_function_value',
    'table' => 'node_data_field_financing_function',
    'field' => 'field_financing_function_value',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('sorts', array(
  'title' => array(
    'order' => 'ASC',
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'field_financing_organization_value' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 0,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all-types',
    'wildcard_substitution' => 'All',
    'title' => 'Listings Directory: %1',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'ignore',
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'id' => 'field_financing_organization_value',
    'table' => 'node_data_field_financing_organization',
    'field' => 'field_financing_organization_value',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => 'all-types',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'image' => 0,
      'product' => 0,
      'listing' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => '',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'validate_argument_php' => '',
  ),
  'field_financing_function_value' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 0,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all-functions',
    'wildcard_substitution' => 'All',
    'title' => 'Listings Directory: %1',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'ignore',
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'id' => 'field_financing_function_value',
    'table' => 'node_data_field_financing_function',
    'field' => 'field_financing_function_value',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => 'all-functions',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'image' => 0,
      'product' => 0,
      'listing' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => 'name',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'listing' => 'listing',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('title', 'Listings Directory');
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'table');
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'listings-directory');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'Listings Directory',
  'description' => '',
  'weight' => '-4',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));
$handler = $view->new_display('attachment', 'ArgAttach: Financing Functions', 'attachment_1');
$handler->override_option('arguments', array(
  'field_financing_organization_value' => array(
    'default_action' => 'summary asc',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 1,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all-types',
    'wildcard_substitution' => 'All',
    'title' => 'Type of Organization',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'php',
    'validate_fail' => 'summary asc',
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'id' => 'field_financing_organization_value',
    'table' => 'node_data_field_financing_organization',
    'field' => 'field_financing_organization_value',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'image' => 0,
      'product' => 0,
      'listing' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => '',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'validate_argument_php' => 'return FALSE;',
  ),
  'field_financing_function_value' => array(
    'default_action' => 'summary asc',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 1,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all-functions',
    'wildcard_substitution' => 'All',
    'title' => 'Organization Financing Functions',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'php',
    'validate_fail' => 'summary asc',
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 0,
    'id' => 'field_financing_function_value',
    'table' => 'node_data_field_financing_function',
    'field' => 'field_financing_function_value',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'image' => 0,
      'product' => 0,
      'listing' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => '',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'validate_argument_php' => 'return FALSE;',
  ),
));
$handler->override_option('title', 'Organization Financing Functions');
$handler->override_option('attachment_position', 'before');
$handler->override_option('inherit_arguments', 1);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'page_1' => 'page_1',
  'default' => 0,
));
$handler = $view->new_display('attachment', 'ArgAttach: Organization Type', 'attachment_2');
$handler->override_option('arguments', array(
  'field_financing_organization_value' => array(
    'default_action' => 'summary asc',
    'style_plugin' => 'default_summary',
    'style_options' => array(
      'count' => 1,
      'override' => 0,
      'items_per_page' => '25',
    ),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => 'Browse Listings: %1',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'php',
    'validate_fail' => 'summary asc',
    'add_table' => 0,
    'require_value' => 0,
    'reduce_duplicates' => 1,
    'id' => 'field_financing_organization_value',
    'table' => 'node_data_field_financing_organization',
    'field' => 'field_financing_organization_value',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'blog' => 0,
      'image' => 0,
      'product' => 0,
      'listing' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'user_argument_type' => '',
    'restrict_user_roles' => 0,
    'user_roles' => array(),
    'validate_argument_php' => 'return FALSE;',
  ),
));
$handler->override_option('title', 'Organization Type');
$handler->override_option('attachment_position', 'before');
$handler->override_option('inherit_arguments', TRUE);
$handler->override_option('inherit_exposed_filters', FALSE);
$handler->override_option('displays', array(
  'default' => 0,
  'page_1' => 0,
));

Comments

carlosdavis’s picture

Okay, I experimented a bit more and made some discoveries. If the attachment does not inherit the page argument, I can never get the second argument summary to display. If the attachment does inherit the page argument, I can get the second argument summary to display when the first argument is 'all' but at no other time.

I wanted persistent display of the argument summaries so I used the PHP return FALSE; method described here:
http://drupaleasy.com/blogs/ultimike/2009/02/using-display-attachments-p...

I am about to remove this auto-FALSE validation and see what I can get.

merlinofchaos’s picture

Suggestion: Try "Global: Null" as the first argument on the 2nd attachment, so that the 2nd argument is the only one that is actually paid attention to. Then both attachments should inherit arguments.

dawehner’s picture

Category: task » support

Update category

esmerel’s picture

Status: Active » Fixed

Solution suggested

Status: Fixed » Closed (fixed)
Issue tags: -views, -arguments, -attachments

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