function paragraphs_theme_suggestions_paragraph

Implements hook_theme_suggestions_HOOK().

File

paragraphs/paragraphs.module, line 89
Contains paragraphs.module

Code

function paragraphs_theme_suggestions_paragraph(array $variables) {
  $suggestions = array();
  $paragraph = $variables['elements']['#paragraph'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'paragraph__' . $sanitized_view_mode;
  $suggestions[] = 'paragraph__' . $paragraph
    ->bundle();
  $suggestions[] = 'paragraph__' . $paragraph
    ->bundle() . '__' . $sanitized_view_mode;
  return $suggestions;
}