I got this from Stack Exchange. It makes it possible to have individual twigs for display modes:
https://drupal.stackexchange.com/questions/201210/field-template-for-dis...

Makes theming a much better experience.

function MYTHEME_theme_suggestions_field_alter(&$suggestions, $variables) {
  $suggestions[] = 'field__' . 
    $variables['element']['#field_name'] . '__' . 
    $variables['element']['#view_mode'];
}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

HongPong created an issue. See original summary.

tanmaykadam’s picture

Status: Active » Needs review
FileSize
686 bytes

I have added a patch for theme suggestions.

HongPong’s picture

Thanks tanmaykadam this is working as expected! Committing now.

  • HongPong committed 5b48b61 on 8.x-6.x authored by tanmaykadam
    Issue #2962578 by tanmaykadam: Add theme suggestions for fields based on...
HongPong’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.