(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?
Comment | File | Size | Author |
---|---|---|---|
#6 | views-template-suggestions-2839945-2.patch | 805 bytes | bapi_22 |
Issue fork drupal-2839945
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
wturrell CreditAttribution: wturrell commentedRemove question about listing possible templates in UI, as supposedly views_templates module does that – unable to install it, will ask elsewhere
Comment #3
Lendude@wturrell not a clue about what's going on, but moving this to the right queue.
Comment #4
bobthebuilder CreditAttribution: bobthebuilder commentedI'm having the same issue with Drupal 8.3 and I'm using the Bootstrap theme as the base module:
Comment #5
bapi_22 CreditAttribution: bapi_22 at Cybage Software Pvt Ltd. commentedThease 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
Comment #6
bapi_22 CreditAttribution: bapi_22 at Cybage Software Pvt Ltd. commentedHi,
This patch will create possible template suggestions for views template.
In same way we can create suggestion for views display and views field templates.
Comment #9
kdechant CreditAttribution: kdechant at Metal Toad commentedThe patch in #6 worked perfectly for me when I encountered this issue.
Oddly, some of my views were affected while others weren't. I'm not 100% sure why. The one that worked was Solr-backed and the one missing the suggestions was a regular SQL-backed view with a relationship to an Entityqueue. Not sure if that provides any useful info.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commented#6 nice patch! But looks like this issue is duplicate of #2923634: [PP-1] Use hook_theme_suggestions in views, where the problem is solved by eliminating the root cause.
Comment #12
komlenic CreditAttribution: komlenic commentedThe file name suggestions in #5 have been invaluable until this is fixed. Thanks.
Comment #18
LendudeClosing this as a duplicate of #2923634: [PP-1] Use hook_theme_suggestions in views, if you feel this is addressing a different issue, feel free to reopen this.