How to replace url of taxonomy label link? I want to alter url of a field and his display.
The field is a taxonomy label with link to the entity.
The default url is : taxonomy/term/{tid}

I wanto to chage with : my_specific_page?technologie={tid} (used to prepopulate exposed filter)

I tried with :

function MYTHEME_preprocess_field__field_technologie(&amp;$variables, $hook){
  $element = $variables['element'];

  foreach ($variables['items'] as $item) {

    $route_name = 'entity.node.canonical';
    $params     = 39;

    $options = [
      'query' =&gt; ['technologie' =&gt; 27],
    ];
    $url = Url::fromRoute($route_name, array('node' =&gt; $params), $options);

    $item['content']['#url'] = $url;
  }
}


I think i need to replace routeName attribut, but how ?

Content type : "manage field"

Content type : "manage display"

Kint result $variables['element']
[]3
I found solution :

function MYTHEME_preprocess_field__field_technologie(&amp;$variables, $hook){
  $element = $variables['element'];

  foreach ($variables['items'] as $index =&gt; $item) {

    $route_name = 'entity.node.canonical';
    $params     = 39;
    $tid = $item['content']['#options']['entity']-&gt;id();

    $options = [
      'query' =&gt; ['technologie' =&gt; $tid],
    ];

    $url = Url::fromRoute($route_name, array('node' =&gt; $params), $options);
    $variables['items'][$index]['content']['#url'] = $url;
  }
}