Problem/Motivation
While working on #3591025: Add a ViewTemplateSource for slots, we have noticed than view templates with suggestions are not overridden by Display Builder.
For example, views-view--articles--page-1.html.twig and some DaisyUI markup:
<div{{ attributes.addClass(classes).addClass("grid", "grid-cols-12", "gap-4") }}>
<div class="col-span-6">
<div class="card bg-base-100 shadow-sm">
<div class="card-body">
{{ header }}
{{ footer }}
</div>
</div>
</div>
<div class="col-span-6">
{{ rows }}
</div>
</div>
Steps:
- Before I switch to display builder, I see my view with this the expected
views-view--articles--page-1.html.twig
- I switch to display builder: the builder and preview panels show the flat list of sources imported from
fixtures/default_view.yml
- I build my display and I publish the display: ❌ the view renderer in front is still
views-view--articles--page-1.html.twig. I can't see what I have just built in Display Builder.
Proposed resolution
Override also the template suggestions when Display Builder is activated for a view display.
Comments
Comment #3
pdureau commentedVery simple fix ;)
I have tried to add a kernel test addressing this case, but I am struggling.
Comment #4
mogtofu33 commented