Found another bug. The layout doesn't respect the templates of the blocks.

In the template of the layout, you make a call directly to the content of the block displaying the fields but by doing so you break the right rendering of the block that we would expect from Drupal (block.html.twig is currently never called). If someone overrides this template, you will not have that override any more. I guess this has been done to hide the title but you have the "Display Title" checkbox to do that and this change breaks also that feature by the way.

Small patch attached.

PS: if we want to hide the title by default, I propose to open a new issue for that. A preprocess to uncheck the checkbox seems more appropriate than changing the right call order of the templates.

CommentFileSizeAuthor
layout_builder_tabs-respect_templates.patch469 bytesphjou

Comments

phjou created an issue. See original summary.

mandclu’s picture

Status: Needs review » Fixed

Good point, and I agree about allowing the editor to hide the title via the checkbox. I would still like something in the Layout Builder presentation that shows/simulates the tab above the content, but that can be a separate issue.

Merged this in, also cleaned up some code and switched to a different selector for the title markup.

phjou’s picture

Version: » 1.x-dev

Yes I agree with you that it would be nice to emulate the tabs in layout builder :) But since you merged the two patches, the module is at least working for me.

Status: Fixed » Closed (fixed)

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