I have a custom template with the following twig file:
views-view-unformatted--offices_contact_us_page_.html.twig
The view is added as part of extra fields module inside of a Drupal paragraph. I have tried everything but simply cannot get the hook to work, however, the .theme file is loaded correctly as I can add an exit to the preprocess_page() function and that works.
I have tried:
- _preprocess_views_view_unformatted()
- _preprocess_views_view_unformatted__offices_contact_us()
- _proprocess_node()
- _preprocess_views()
I am able to inject my variables through the _preprocess_page, but then the variable is not available inside the above view, so need to alter that hook. Any ideas as to what I am doing wrong or alternatively is there a way for me to "print" all hooks that are loaded (like their names) during the request so that I can better determine what I am doing wrong?
<h1>Foobar</h1>
into the template does it get printed or not? Have you enabled Twig debugging? There you'll see next to the template suggestions which hook you can hook in. Where exactly did you place the hooks? And how are they named exactly? Please update your question._preprocess_views_view_unformatted__offices_contact_us_()