- ๐บ๐ธUnited States mettasoul
I 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
/** * {@inheritdoc} */ public function preprocessTitle(&$vars, $node, $view_mode) { if ($this->isTitleExcluded($node, $view_mode)) { $node_info = $this->getNodeInfo($node); $node_type = $node_info['node_type']; switch ($view_mode) { case 'nodeform': $node_types = $this->bundleInfo->getBundleInfo('node'); if (!empty($vars['head_title'])) { $vars['head_title']['title'] = new TranslatableMarkup('Edit @nodetype', ['@nodetype' => $node_types[$node_type]['label']]); } elseif (!empty($vars['title'])) { $vars['title'] = new TranslatableMarkup('Edit @nodetype', ['@nodetype' => $node_types[$node_type]['label']]); } break; default: if (!empty($vars['title'])) { if ($this->isRenderHidden()) { $vars['title_attributes']['class'][] = 'hidden'; } elseif ($this->isRenderRemove()) { $vars['title'] = new HtmlEscapedText(''); } } if (!empty($vars['page']) && is_array($vars['page'])) { if ($this->isRenderHidden()) { $vars['page']['#attributes']['class'][] = 'hidden'; } elseif ($this->isRenderRemove()) { $vars['page']['#title'] = new HtmlEscapedText(''); } } if (!empty($vars['elements']) && is_array($vars['elements'])) { if ($this->isRenderHidden()) { $vars['elements']['#attributes']['class'][] = 'hidden'; } elseif ($this->isRenderRemove()) { $vars['elements']['#title'] = new HtmlEscapedText(''); } } if (!empty($vars['label']) && is_array($vars['elements'])) { if ($this->isRenderHidden()) { $vars['label']['#attributes']['class'][] = 'hidden'; } elseif ($this->isRenderRemove()) { $vars['label']['#title'] = new HtmlEscapedText(''); $vars['label']['#markup'] = new HtmlEscapedText(''); $vars['label'][0]['#context']['value'] = ''; $vars['label'][0]['#title']['#context']['value'] = ''; } } break; } } return $this; }
- ๐ฎ๐ณIndia Sahana _N
Sahana _N โ made their first commit to this issueโs fork.
- Merge request !7Issue #3160620: Title exclusion is overridden if Layout Builder layout has title field โ (Open) created by Sahana _N
- Status changed to Needs review
about 1 year ago 11:25am 4 October 2023 - Status changed to RTBC
6 months ago 10:06pm 14 May 2024 - ๐จ๐ฆCanada leducdubleuet Chicoutimi QC
I can confirm the patch is working properly! Thank you!
- ๐บ๐ธUnited States sea2709 Texas
I confirm the MR fixed the issue when the title is showing twice on my end!
- First commit to issue fork.
The patch helped. But I still had issues with the title showing up on pages using layout builder. Unsetting the label[0] element fixed everything for me. I pushed up a change to the issue fork.