1

I have added twig suggestion from .theme file to views__view.html.twig for customizing taxonomy.

   function mediumish_blog_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
      if (\Drupal::routeMatch()->getRouteName() == 'entity.taxonomy_term.canonical' && $tid = \Drupal::routeMatch()->getRawParameter('taxonomy_term')) {
       $term = Term::load($tid);
       $suggestions[] = 'views__view__taxonomy_term';
     }
   }

I am getting suggestion in twig suggestion display but when i am creating file and applying my custom theme, its not actually displaying output of that file, Its still using the default views--view.html.twig.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.