Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When placing the title block it is not rendered.
This seems to be a common problem in panels space:
page_manager: #2626090: Page title block placed on block page renders empty
panels: #2869412: Page title does not display
Proposed resolution
Try fixing it by using the fix contained in #2858004-9: Use PE display variant on any path without route overrides.
Remaining tasks
Write test that verifies the bug.Apply fix from #2858004-9: Use PE display variant on any path without route overrides- Compare solution with solutions in other issues
Comment | File | Size | Author |
---|---|---|---|
#9 | panels_everywhere-n2933423-9.interdiff.txt | 2.94 KB | DamienMcKenna |
#9 | panels_everywhere-n2933423-9.patch | 5.51 KB | DamienMcKenna |
#8 | panels_everywhere-n2933423-8.patch | 5.12 KB | DamienMcKenna |
|
Comments
Comment #2
Alumei CreditAttribution: Alumei commentedUpdate summary with references to same problem in panels & page manager.
Comment #3
Alumei CreditAttribution: Alumei commentedCreated patch with test only as well as one with the test included.
Comment #4
Alumei CreditAttribution: Alumei commentedTrigger tests.
Comment #5
Alumei CreditAttribution: Alumei commentedOh .. wrong testOnly patch.
Comment #7
DamienMcKennaComment #8
DamienMcKennaLets shorten that test class name.
Comment #9
DamienMcKennaMinor tweaks on the comments.
Comment #10
Alumei CreditAttribution: Alumei commentedWhile working on #2869412: Page title does not display I realized that panels allows the title to be set statically inside the panel. It also allows for token replacement.
Now if I understand #2858004: Use PE display variant on any path without route overrides correctly that should allow token replacement to work as that replacement seems to rely on contextual information.
Such token replacement should normally have access to the page title see #2714257: [current-page:title] not working properly on pages with a render array as title.
As the current behavior does not take into consideration the configured panels page title but actually overrides it in
PanelsEverywhereDisplayVariant:build()
, ensuring that [current-page:title] in the panels title input contains the correct value seems to be the most reasonable.I also had another idea, which was about providing a special placeholder like '
<original>
' which could be put into the panels title field.During rendering we could check the configured panels title and use the current behavior in case '<original>
' was present and use the rendered configured title otherwise. In contrast that does seem as nice as the simple power of token replacement.Comment #11
DamienMcKennaAt the very least this needs to be rerolled.