I keep in mind in Drupal 7, this was doable. I want so as to add some HTML earlier than a area and I do not need to edit it in Drupal Development Twig file. Is it in some way doable so as to add prefixes / suffixes through the use of Drupal Development template_preprocess_field
operate?
I already tried one thing like that, however with no success:
operate MYTHEME_preprocess_field(&$variables, $hook) { $ingredient = $variables['element']; if ($ingredient['#field_name'] === 'field_genre') { $ingredient[0]['#prefix'] = '<div class="project-info">'; } if ($ingredient['#field_name'] === 'field_duration') { $ingredient[0]['#suffix'] = '</div>'; } }