You are here

function toc_js_theme_suggestions_toc_js_alter in Toc.js 8

Same name and namespace in other branches
  1. 2.0.x toc_js.module \toc_js_theme_suggestions_toc_js_alter()

Implements hook_theme_suggestions_HOOK_alter().

File

./toc_js.module, line 67
Contains toc_js.module.

Code

function toc_js_theme_suggestions_toc_js_alter(array &$suggestions, array $variables) {

  /** @var \Drupal\Core\Entity\EntityInterface $entity */
  if ($entity = $variables['entity']) {
    $suggestions[] = 'toc_js__' . $entity
      ->getEntityTypeId();
    $suggestions[] = 'toc_js__' . $entity
      ->getEntityTypeId() . '__' . $entity
      ->bundle();
    $suggestions[] = 'toc_js__' . $entity
      ->getEntityTypeId() . '__' . $entity
      ->bundle() . '__' . $entity
      ->id();
  }
}