Skip to main content
Commonmark migration
Source Link

Yes, you can easily create an override for views-view.html.twig which will only apply to a single View.

Taking the example from Views template files:

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

So if your View is called "articles", you can use views-view--articles.html.twig to override the template for the whole View, views-view--articles--page.html.twig to target just a display named page for the same view, and so on.

Yes, you can easily create an override for views-view.html.twig which will only apply to a single View.

Taking the example from Views template files:

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

So if your View is called "articles", you can use views-view--articles.html.twig to override the template for the whole View, views-view--articles--page.html.twig to target just a display named page for the same view, and so on.

Yes, you can easily create an override for views-view.html.twig which will only apply to a single View.

Taking the example from Views template files:

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

So if your View is called "articles", you can use views-view--articles.html.twig to override the template for the whole View, views-view--articles--page.html.twig to target just a display named page for the same view, and so on.

Source Link
Clive
  • 168.5k
  • 19
  • 305
  • 338

Yes, you can easily create an override for views-view.html.twig which will only apply to a single View.

Taking the example from Views template files:

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

So if your View is called "articles", you can use views-view--articles.html.twig to override the template for the whole View, views-view--articles--page.html.twig to target just a display named page for the same view, and so on.