I need to remove an entity from the display.
With hook_entity_view_alter()
, I am trying to change the $build
array.
$build['disable'] = true;
$build['#entity']['disable'] = true;
$build['#entity'] = "";
$build['#entity']['#access'] = FALSE;
This is all wrong.
$build['entity'] is of type Drupal\eck\Entity\EckEntity and not a renderarray.
What is the correct way to hide an entity from the display?
$build['entity']['#access'] = FALSE;
?#access
to false.