I have a view containing an unformatted list of fields. I want to create a specific template for the view. I have turned on Twig debug, but it suggests 'views_view_unformatted' for the file name, which would apply to all unformatted lists, but I want it specific to this view. What should be file name be?

  • Enable twig debugging by copying default.services.yml to services.yml and following instructions in the twig.config section. The debugging comments will display template file name hints in HTML comments in the page output.
    – mona lisa
    Commented Jan 29, 2016 at 23:25
  • 2
    As I say in my post, I have already turned on debug and the suggested file names are not helpful.
    – James
    Commented Feb 1, 2016 at 6:31

4 Answers 4


I think the issue here is that Twig debug does not suggest all possible names.

Names containing the view display id or type are possible, but don't seem to be suggested by Twig debug.

The following are the possible template names sorted by precedence:

[base template name]--[view machine name]--[view display id].html.twig
[base template name]--[view machine name]--[view display type].html.twig
[base template name]--[view display type].html.twig
[base template name]--[view machine name].html.twig
[base template name].html.twig

To create template for view use following naming convention :


Use page if you are creating template for page view and block for block view

Hope this helps :)


I searched for a while till I finally found the solution in the Drupal API:


So the correct filename for your case would be:

views-view-unformatted--[view machine name]--[display].html

Like for example:


to be more precised with underscore and comma

  • get the view machine name and display name from url


  • then the template name would be
  • for all display of type page for that view:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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