You are here

function paragraphs_theme_suggestions_paragraph in Paragraphs 8

Implements hook_theme_suggestions_HOOK().

File

./paragraphs.module, line 88
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;
}