I am trying to programmatically set a link in a Drupal 8 view. The client wants an external link used if a certain link field is set, otherwise default the link to the node.
I am trying to figure out how to set this, and despite looking at hook_views_pre_render() and hook_views_post_render(), I'm not seeing any method to make this happen. I'm trying to go into result -
foreach ($view->result as $key => $value) {
}
However Kint is giving me data like this:
public _relationship_entities -> array(0)
public index -> integer7
public node_field_data_langcode -> string(2) "en"
public nid -> string(2) "99"
for each ResultRow.
I don't remember this being particularly difficult in Drupal 7 - is there something I'm missing here? How do I programmatically set a link in Drupal 8 dependent on certain conditions for a view row/field in a row?