Score:0

hook_theme_suggestions_node_alter() doesn't work for new files

cn flag

I implemented hook_theme_suggestions_node_alter() and added a new suggestion for a custom template file. In the inspector, I can see the suggestion is picked up. I created that file, but it doesn't seem it's loaded.

The module is inside modules/custom/gf_them_module/ and the custom theme is in themes/custom/gf_theme/. The new file, node--products-template--simple.html.twig, is in themes/custom/gf_theme/templates/content, the same directory as the other suggestion template file like node.html.twig. After clearing the cache, the file isn't loaded.

Can anybody help?

This is the directory containing the file. I placed one under system and the other under content but it's still the same.

screenshot

The file is suggested, but it's not loaded.

screenshot

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.