If a node has already been selected during the current session or one prior, the node shouldn't be displayed in the results.
At the very least, could we have the checkbox selected to show it's already been added?

Thanks

Comments

bojanz’s picture

This should already work, from the project page:

The module has a way of hiding selected items from the View.
Simply add a base field contextual argument (Product ID for products, Node ID for nodes, etc)
and in the "More" fieldset enable "Allow multiple values" and "Exclude".
Then edit the Entity Reference field, and in the widget settings enable "Pass selected entity ids to View ".

Did you try that?

tseven’s picture

Doh, can't believe I didn't see that.

Thank you for being polite and helpful :)

bojanz’s picture

Category: feature » support
Status: Active » Fixed

You're welcome :)

Status: Fixed » Closed (fixed)

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

chunglk’s picture

StatusFileSize
new6.66 KB

Then edit the Entity Reference field, and in the widget settings enable "Pass selected entity ids to View ".
You can go to "Content type -> manager field -> entity reference field -> edit"

minneapolisdan’s picture

StatusFileSize
new121.95 KB

Thank you for the clear directions, but it's not working for me. I'll keep trying, but here's my view (below) and a screenshot of my widget settings.

$view = new view();
$view->name = 'lexicon';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Lexicon';
$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['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'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '160';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
/* Sort criterion: Content: Title */
$handler->display->display_options['sorts']['title']['id'] = 'title';
$handler->display->display_options['sorts']['title']['table'] = 'node';
$handler->display->display_options['sorts']['title']['field'] = 'title';
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['nid']['break_phrase'] = TRUE;
$handler->display->display_options['arguments']['nid']['not'] = TRUE;
/* Filter criterion: Content: Published */
$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;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'glossary' => 'glossary',
);

/* Display: Entity Reference View Widget */
$handler = $view->new_display('entityreference_view_widget', 'Entity Reference View Widget', 'entityreference_view_widget_1');
$handler->display->display_options['defaults']['title'] = FALSE;
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['defaults']['exposed_form'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'entityreference_view_widget';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'grid';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'entity';
$handler->display->display_options['row_options']['view_mode'] = 'entityreference_view_widget';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['hide_left'] = 0;
adamgerthel’s picture

Then edit the Entity Reference field, and in the widget settings enable "Pass selected entity ids to View ".
You can go to "Content type -> manager field -> entity reference field -> edit"

This doesn't work for me, not even when previewing the view in edit mode and manually typing in the contextual filter arguments. It seems that using OR (i.e. "4+5" etc) might not work very well in Views. I'm not sure, but it might be a views issue. I've seem some related topics:

#1396622: Taxonomy term contextual filters use OR instead of AND; matching multiple terms is not possible
#1363436: AND operator in Views Contextual Filters for multiple values