0

I have a very simple view that displays the author UID as well as the (entity)recipient UID. How do I show results for arg1/arg2 AND arg2/arg1

First Argument: Author UID Second Argument: Entity UID

This works: mywebsite/msg/1/3 and this: mywebsite/msg/3/1

I need my view to show all results regardless of the order of the arguments but since they are 2 different fields the "Allow Multiple Values" doesn't seem to work.

Here is an export of my view

$view = new view();
$view->name = 'newmessanger';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'newmessanger';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

Display: Master

$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'newmessanger';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'table';
$handler->display->display_options['style_options']['columns'] = array(
  'title' => 'title',
  'field_zmsgrecipient' => 'field_zmsgrecipient',
  'uid' => 'uid',
);
$handler->display->display_options['style_options']['class'] = '';
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
  'title' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'field_zmsgrecipient' => array(
    'sortable' => 0,
    'default_sort_order' => 'asc',
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
  'uid' => array(
    'align' => '',
    'separator' => '',
    'empty_column' => 0,
  ),
);

Relationship: Entity Reference: Referenced Entity

$handler->display->display_options['relationships']['field_zmsgrecipient_target_id']['id'] = 'field_zmsgrecipient_target_id';
$handler->display->display_options['relationships']['field_zmsgrecipient_target_id']['table'] = 'field_data_field_zmsgrecipient';
$handler->display->display_options['relationships']['field_zmsgrecipient_target_id']['field'] = 'field_zmsgrecipient_target_id';

Field: Content: Recipient

$handler->display->display_options['fields']['field_zmsgrecipient']['id'] = 'field_zmsgrecipient';
$handler->display->display_options['fields']['field_zmsgrecipient']['table'] = 'field_data_field_zmsgrecipient';
$handler->display->display_options['fields']['field_zmsgrecipient']['field'] = 'field_zmsgrecipient';
$handler->display->display_options['fields']['field_zmsgrecipient']['settings'] = array(
  'bypass_access' => 0,
  'link' => 0,
);

Field: Content: Author Uid

$handler->display->display_options['fields']['uid']['id'] = 'uid';
$handler->display->display_options['fields']['uid']['table'] = 'node';
$handler->display->display_options['fields']['uid']['field'] = 'uid';
$handler->display->display_options['fields']['uid']['label'] = 'author';

Field: User: Uid

$handler->display->display_options['fields']['uid_1']['id'] = 'uid_1';
$handler->display->display_options['fields']['uid_1']['table'] = 'users';
$handler->display->display_options['fields']['uid_1']['field'] = 'uid';
$handler->display->display_options['fields']['uid_1']['relationship'] = 'field_zmsgrecipient_target_id';
$handler->display->display_options['fields']['uid_1']['label'] = 'Recipient Uid';

Sort criterion: Content: Post date

$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';

Contextual filter: User: Uid

$handler->display->display_options['arguments']['uid_1']['id'] = 'uid_1';
$handler->display->display_options['arguments']['uid_1']['table'] = 'users';
$handler->display->display_options['arguments']['uid_1']['field'] = 'uid';
$handler->display->display_options['arguments']['uid_1']['relationship'] = 'field_zmsgrecipient_target_id';
$handler->display->display_options['arguments']['uid_1']['default_action'] = 'default';
$handler->display->display_options['arguments']['uid_1']['default_argument_type'] = 'user';
$handler->display->display_options['arguments']['uid_1']['default_argument_options']['user'] = FALSE;
$handler->display->display_options['arguments']['uid_1']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid_1']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid_1']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['uid_1']['break_phrase'] = TRUE;

Contextual filter: Content: Author uid

$handler->display->display_options['arguments']['uid']['id'] = 'uid';
$handler->display->display_options['arguments']['uid']['table'] = 'node';
$handler->display->display_options['arguments']['uid']['field'] = 'uid';
$handler->display->display_options['arguments']['uid']['default_action'] = 'default';
$handler->display->display_options['arguments']['uid']['default_argument_type'] = 'user';
$handler->display->display_options['arguments']['uid']['default_argument_options']['user'] = FALSE;
$handler->display->display_options['arguments']['uid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['uid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['uid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['uid']['break_phrase'] = TRUE;

Filter criterion: Content: Published status

$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;

Display: Page

$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['path'] = 'msg/%/%';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.