I have a taxonomy called Fish and 2 terms in it. Bass and Gold. I have a term reference field on a Page node, and its a select list. The editor can select either Bass or Gold. And I want display something depending on what the user selects. I cannot get it to work. This is what I have tried. Below the Bass tid is '1'.
I want create custom template for each content type.
I have defined mytheme_theme_suggestions_page_alter(..) and files in /templates/*.html.twig. The problem is that drupal dont load content to template.
mytheme.theme
function mytheme_theme_suggestions_page_alter(array &$suggestions, array $variables) {
if ($node = \Drupal::routeMatch()->getParameter('node')) {
$content_type = $node->bundle();
$suggestions[] = "page__".$content_type;
}
}