Exclude Node Title preference on an entity (like a Content Type) is overwritten if the view mode has a Layout Builder configuration which contains the Title field, leading to the Title field being shown twice (once for the default, supposed to be overwritten title; and once for the custom field).
To reproduce:
1. Configure Exclude Node Title for the content type and the associated display (in this example, Teaser).
2. Configure the Content Type display mode for Teaser to use Layout Builder, and add the Title field to a Section within LB.
3. Save the Layout.
4. Ta-da! You've worked around Exclude Node Title.
Issue fork exclude_node_title-3160620
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:
- 3160620-title-exclusion-is
changes, plain diff MR !7
Comments
Comment #2
WebbehComment #3
bigjim commentedI can confirm this issue, sadly I don't have a patch to fix :(
Comment #4
bigjim commentedOkay, though I can re-create the issue I just realized it's only when the "Link to the Content" box is checked on the title block in LB
Comment #5
tonytheferg commentedI can confirm.
Comment #6
Christopher Riley commentedThis is kind of a deal breaker. It would be nice if it was addressed.
Comment #7
jrochate commentedI've tried to remove the "Link to the Content" checkbox, but still the title still appears when using LB
Comment #8
cbwiedel commentedAlso an issue with Display Suite, please fix
Comment #9
mav_fly commentedI have the same problem
Comment #10
stevenjay commentedI ran into this problem and was able to solve it by adding the following line of code to the preprocessTitle procedure in /src/Plugin/DsField/Node/ExcludeNodeTitleManager.php
After line 265: $vars['label'][0]['#context']['value'] = '';
Added: $vars['label'][0]['#title']['#context']['value'] = '';
Hope this helps fix the issue
Comment #13
sahana _n commentedCreated a MR please review.
Comment #14
leducdubleuet commentedI can confirm the patch is working properly! Thank you!
Comment #15
sea2709 commentedI confirm the MR fixed the issue when the title is showing twice on my end!
Comment #17
_kash_ commentedThe patch helped. But I still had issues with the title showing up on pages using layout builder when using a display mode other than default. Unsetting the label[0] element fixed everything for me. I pushed up a change to the issue fork.
Comment #20
smustgrave commented