I have created an article listing view with a view mode "Teaser Full Width". The page looks fine and articles listed. When I tried to edit something using template_preprocess_node(&$variables), the hook is not working in Teaser Full Width. But the same work in the individual node when I click any article.
<?php
function templatename_preprocess_node(&$variables) {
kint($variables);die('test');
}
?>
I have already gone through different questions in StackOverflow.
- Devel module enabled.
- Tried with condition
if ($variables['view_mode'] == 'teaser_full_width'){ ... } - Tried
print_rinstead ofkint. - Tried by changing
max_allowed_packet. - Verified
templatenameis enabled and set as default. - Cache Cleared.
(Article Listing Page) Template file:- node--article--teaser-full-width.html.twig
template_preprocess_html is working fine on this page.
template_preprocess_node not working on this page.
(Article Single Page) Template file:- node--article--full.html.twig
Both hooks are working fine.
Does anyone know what the issue is? My drupal version is 8.6.10.