Question: Visiting a node *Foobar* a breadcrumb gets created which adds the parent menu structure like so:

```
$currentPluginId = $menu_link->getPluginId();
$trailIds = $this->menuActiveTrail->getActiveTrailIds('main');

foreach (array_reverse($trailIds) as $key => $value) {
  if ($value && $value !== $currentPluginId) {
    // @todo add cache per item
    $instance = $menu_link_manager->createInstance($value);
    $breadcrumb->addLink(
      new Link(
        $instance->getTitle(),
        $instance->getUrlObject()
      )
    );
  }
}

$breadcrumb->addCacheContexts(['route.menu_active_trails:main']);

```

So the breadcrumb looks like:

> 
> Home > John Doe > **Foobar**
> 
> 
> 

But if the node/ menu item of *John Doe* changes, the breadcrumb for *Foobar* stays the same.

```
dpm($instance->getUrlObject()->getRouteName());
dpm($instance->getUrlObject()->getRouteParameters());

```

gives me: 

> 
> entity.node.canonical
> 
> 
> 

and

> 
> array(
>  [node] => 25 )
> 
> 
> 

How can I use that for adding each breadcrumb part as cache context/ tag?

Answer: 
What you want is views' right column.

You need to use a contextual filter of `Content: nid`, choose to provide a default value `Content id from url`. If you want to suppress the current product (eg. for a related products display use the `Exclude` option in the `More` fieldset at the bottom.)

Then add a relationship and select your entity reference field.

Finally you can add the field `Content: rendered node` and at the top choose your newly created relationship. This should give you a list of referenced products.

Update: I guess the exclude option takes no effect in this case, since you'll be only listing the referenced products.
I found solution by adding new filter criteria of Global:PHP(PHP) type, where you can type your own php logic, in my case:

```
$node = node_load(arg(1));

if(isset($node->field_recommended_products['und'][0])) {

  foreach($node->field_recommended_products['und'] as $prod)  {

     if($prod['target_id'] == $data->nid) {
       return true;
     } else { return false; }

  }

} else {
  return false; 
}

```