(Drupal 8.2.4, using a custom theme that has 'stable' as the base.)

I'm not sure if I've broken something, but (having rebuilt the cache etc.) the FILE NAME SUGGESTIONS section is missing entirely from the Twig debugging for view pages:

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view' -->
<!-- BEGIN OUTPUT from 'core/themes/stable/templates/views/views-view.html.twig' -->

… when I copy the template from stable to my theme and give it a more specific filename (for a view with a machine name of "gifts"), I get this:

<!-- FILE NAME SUGGESTIONS:
   x views-view--gifts.html.twig
   x views-view--gifts.html.twig
   * views-view.html.twig
-->

which:

a) doesn't list any of the other options (i.e. ID, display type)
b) has the same entry repeated twice

Any ideas?

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

wturrell created an issue. See original summary.

wturrell’s picture

Issue summary: View changes

Remove question about listing possible templates in UI, as supposedly views_templates module does that – unable to install it, will ask elsewhere

Lendude’s picture

Title: File name suggestions often missing from Twig debugging? » Views file name suggestions often missing from Twig debugging
Project: Views » Drupal core
Version: 8.x-3.x-dev » 8.4.x-dev
Component: Miscellaneous » views.module

@wturrell not a clue about what's going on, but moving this to the right queue.

bobthebuilder’s picture

I'm having the same issue with Drupal 8.3 and I'm using the Bootstrap theme as the base module:

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'views_view' -->
<!-- BEGIN OUTPUT from 'sites/all/themes/bootstrap/templates/views/views-view.html.twig' -->
<div class="view view-paragraph-news-listings view-id-paragraph_news_listings view-display-id-paragraph_news_listings_page js-view-dom-id-dd4f956a8b1b10f46748a20333105731585c11cc58ff9e1c0f267d126b3e2f6d">
bapi_22’s picture

Thease are the list of templates provided by views core but it's not included in the theme hook suggestions.

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

bapi_22’s picture

Status: Active » Needs review
FileSize
805 bytes

Hi,

This patch will create possible template suggestions for views template.

In same way we can create suggestion for views display and views field templates.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.