- 🇩🇪Germany captain hindsight
Just a quick question on this, I couldn't find a more appropriate issue. I wondered why ViewExecutable::buildThemeFunctions prefers (or even involves) the display_id as first argument over the view id.
$themes[] = $hook . '__' . $display['id']; ... $themes[] = $hook . '__' . $id;
Is this intended? For me this looks a little bit like gambling, to even involve display_id as first argument. I stumbled on this after using a "views-view--something.html.twig" and wondered why the display of a view matched another html.twig, because its display id matched it, which I never expected...
- 🇫🇷France aiphes
Hi,
So @captain hindsight , do it be necessary to patch to get views template suggestions with display id or just adding code into .theme file ? Something like:
$suggestions[] = 'views_view__' . $variables['view']->id(). '__' . $display['id'];
- last update
about 1 year ago Patch Failed to Apply - 🇨🇭Switzerland tcrawford
I am currently upgrading a project to Drupal 10 and so I have re-rolled #84 for D10.
The patch (2923634-92.patch) is identical as #84, except for removal of the changes to /core/modules/aggregator/src/Plugin/views/row/Rss.php, due to the removal of the aggregator module from core. I have not created an interdiff as the first patch no longer applies on D10.
I hope this assists if you are currently upgrading to D10. As the issue is postponed I have not created a patch against D11.
- last update
about 1 year ago Patch Failed to Apply - last update
12 months ago Patch Failed to Apply - 🇮🇳India manikandank03 Tamil Nadu
@tcrawford, thanks for the D10 patch.
#92 patch cleanly applied Drupal 10.1.1. - last update
9 months ago Patch Failed to Apply - miiimooo Europe
With the patch in #70 against 9.x I got this for example for an exposed views block:
<!-- THEME HOOK: 'form' --> <!-- FILE NAME SUGGESTIONS: * form--audio-series-listing--block-1.html.twig * form--block-1.html.twig x form--audio-series-listing--block.html.twig * form--block.html.twig * form--audio-series-listing.html.twig * form.html.twig * form.html.twig -->
With the latest patches here against 10.x I only get
<!-- THEME DEBUG --> <!-- THEME HOOK: 'form' --> <!-- BEGIN OUTPUT from 'themes/contrib/stable/templates/form/form.html.twig' -->
Going back to #83 against 10.x brings back the theme suggestions (form---VIEW_ID--DISPLAY_ID.html.twig,..) (though it doesn't apply cleanly due to the patch for core/modules/aggregator/src/Plugin/views/row/Rss.php)
Something went missing in #92
- last update
9 months ago Custom Commands Failed - @miiimooo opened merge request.
- 🇺🇸United States ben.hamelin Adirondack Mountains, NY
I did not dig in to this much, but just noting that during an recent upgrade to 10.1 (from 9.5) this patch was breaking suggestions for views - existing template overrides (e.g. views-view-list--[machine_name]) were not being used. Removing the patch resolved for me.
- Status changed to Needs work
8 months ago 9:52am 24 October 2023 - 🇺🇦Ukraine Abyss
This doesn't work quite right for Drupal 10.
Example:
- We have one content type that is displayed in 2 views with the same view mode.
- The views are placed on different pages.
- Create templates for the content from these views.
- Open page 1 and we have the expected result.
- Open page 2 and the content that has already been displayed on page 1 is displayed with the template for the first view.
- Status changed to Postponed
8 months ago 9:53am 24 October 2023 - 🇩🇰Denmark ressa Copenhagen
The patch applies with som difficulties against 10.2.2, but I don't get file name suggestions for Views table:
<!-- THEME DEBUG --> <!-- THEME HOOK: 'views_view_table' --> <!-- BEGIN OUTPUT from 'core/themes/olivero/templates/views/views-view-table.html.twig' --> <table class="views-table cols-1">
Applying the patch:
$ patch -p1 < 4947.diff patching file core/modules/comment/src/Plugin/views/row/Rss.php patching file core/modules/node/src/Plugin/views/row/Rss.php patching file core/modules/search/src/Plugin/views/row/SearchRow.php patching file core/modules/views/src/Form/ViewsExposedForm.php Hunk #1 succeeded at 136 (offset -8 lines). <<<<<< A few of these, as well as "succeeded at 63 with fuzz 1" [...]