I have two custom page views, one showing content, and a second one showing taxonomy term. The first one's template override suggestion as expected is views-view--{viewname}.html.twig, I do not get the same override functionality for the second view though. Am I missing something here or is it just the way it is?


I have also noticed that the template suggestions for views is sometimes gone, but as drupal.org writes you can just name your templates like this.

For example, if you have a view called foobar, then you shall call your template views-view--foobar.html.twig.

For more information, see Views template files.


You can enable twig debug - this will output, as html comments (you'll have to inspect the dom), all twig override options above all twig rendered output. Check out this page for more info: https://www.drupal.org/docs/8/theming/twig/debugging-twig-templates

One note I'll make is that I would use the development.services.yml file to make this override if you're using a settings.local.php. You can find that file and information about how to use it at sites/development.services.yml. You'll have to copy that file to your site's directory for your current site, e.g. sites/default/development.services.yml and then add the configuration for enabling twig debug there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.