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:

  1. Before I switch to display builder, I see my view with this the expected views-view--articles--page-1.html.twig
  2. I switch to display builder: the builder and preview panels show the flat list of sources imported from fixtures/default_view.yml
  3. 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.

Command icon 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

pdureau created an issue. See original summary.

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Active » Needs review

Very simple fix ;)

I have tried to add a kernel test addressing this case, but I am struggling.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • mogtofu33 committed da2e0dda on 1.0.x authored by pdureau
    fix: #3618110 Override views view template suggestions
    
    By: pdureau
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.