Views template suggestion files | Drupal 8

Views template suggestion files

Submitted by editor on Mon, 06/05/2017 - 13:03
Question

How to add template suggestion to a view on drupal 8 ?

All views templates can be overridden with a variety of names, using the view, the display ID of the view, the display type of the view, or some combination thereof.

Naming convention.

View, named foobar. Style: unformatted. Row style: Fields. Display: Page.

views-view--foobar--page.html.twig
views-view--page.html.twig
views-view--foobar.html.twig
views-view.html.twig

views-view-unformatted--foobar--page.html.twig
views-view-unformatted--page.html.twig
views-view-unformatted--foobar.html.twig
views-view-unformatted.html.twig

views-view-fields--foobar--page.html.twig
views-view-fields--page.html.twig
views-view-fields--foobar.html.twig
views-view-fields.html.twig

 

Add new comment