You are here

function layout_paragraphs_theme_suggestions_layout_paragraphs in Layout Paragraphs 2.0.x

Same name and namespace in other branches
  1. 1.0.x layout_paragraphs.module \layout_paragraphs_theme_suggestions_layout_paragraphs()

Implements hook_theme_suggestions().

File

./layout_paragraphs.module, line 78
Contains layout_paragraphs.module.

Code

function layout_paragraphs_theme_suggestions_layout_paragraphs(array $variables) {
  $suggestions = [];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'layout_paragraphs__' . $sanitized_view_mode;
  $suggestions[] = 'layout_paragraphs__' . $variables['elements']['field_name'];
  $suggestions[] = 'layout_paragraphs__' . $variables['elements']['field_name'] . '__' . $sanitized_view_mode;
  return $suggestions;
}