How to modify value of taxonomy field of a node using hook_node_views Drupal 8?

by Anupriya_vij   Last Updated December 19, 2017 14:07 PM

I have a taxonomy field in a content type. I have created a node and added term reference value to this node. Now the node shows up link to the term.

I want the value of the text field added in that taxonomy to be displayed on this node instead of link to the term.

I want to use this hook and set the value of the term field via code

function hook_node_view(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) { }

Tags : entities hooks


Related Questions


Insert data into entity programmatically

Updated May 16, 2017 17:07 PM

How to create edit custom url for entity

Updated July 10, 2017 08:07 AM


How to get nid while inserting new node drupal 8

Updated January 04, 2018 13:07 PM