Answers for "drupal 8 show template suggestions"

PHP
4

drupal 8 enable twig debug

// You enable Twig Debugging in services.yml

parameters:
  twig.config:
    debug: true
Posted by: Guest on July-23-2020
0

drupal 8 suggestions

function MYMODULE_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
  if (\Drupal::currentUser()
    ->isAuthenticated() && in_array($hook, array(
    'node',
    'taxonomy_term',
  ))) {
    $suggestions[] = $hook . '__' . 'logged_in';
  }
}
Posted by: Guest on November-05-2020

Browse Popular Code Answers by Language