Guest User

Untitled

a guest
Jan 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. /**
  2. * Implements hook_theme_suggestions_HOOK_alter().
  3. */
  4. function mytheme_theme_suggestions_paragraph_alter(&$suggestions, $variables) {
  5. $paragraph = $variables['elements']['#paragraph'];
  6. $parent = $paragraph->getParentEntity();
  7. if ($parent) {
  8. $suggestions[] = 'paragraph__' . $parent->bundle() . '_' . $paragraph->bundle();
  9. }
  10. }
Add Comment
Please, Sign In to add comment