Guest User

Untitled

a guest
Aug 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. /**
  2. * Implements hook_preprocess_HOOK().
  3. */
  4. function MYTHEME/MYMODULE_preprocess_field(&$variables) {
  5.  
  6. $view_mode = $variables['element']['#view_mode'];
  7. $field_name = $variables['element']['#field_name'];
  8. $bundle = $variables['element']['#bundle'];
  9.  
  10. $variables['theme_hook_suggestions'][] = 'field__' . $field_name . '__' . $view_mode;
  11. $variables['theme_hook_suggestions'][] = 'field__' . $field_name . '__' . $bundle . '__' . $view_mode;
  12. }
Add Comment
Please, Sign In to add comment