You are here

function config_pages_theme_suggestions_config_pages in Config Pages 8

Same name and namespace in other branches
  1. 8.3 config_pages.module \config_pages_theme_suggestions_config_pages()
  2. 8.2 config_pages.module \config_pages_theme_suggestions_config_pages()

Implements hook_theme_suggestions_HOOK().

File

./config_pages.module, line 79
Module hooks.

Code

function config_pages_theme_suggestions_config_pages(array $variables) {
  $suggestions = [];
  $config_page = $variables['elements']['#config_pages'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'config_pages__' . $sanitized_view_mode;
  $suggestions[] = 'config_pages__' . $config_page
    ->bundle();
  $suggestions[] = 'config_pages__' . $config_page
    ->bundle() . '__' . $sanitized_view_mode;
  return $suggestions;
}