how can I change page title drupal 8 in node with some options? I want change my title on "test" if node have field "field_section" is "dogs". Just in this page I want showing in "field--node--title.html.twig" 'test'.
I tried
function test_theme_preprocess_field(&$variables, $hook) {
if($variables['field_name']=='title'){
$variables['items']['changetitle']=true;
// kint($variables);
}
}
But I don't know how to search from preprocess field other paramters other fields like my field in node 'field_section'.
I want mix in preproccesing_field 'if field_section have value 'dogs' then showing page_title is 'test'.