Problem/Motivation

The Page title rendered value seem to return unexpected markup.
In on my cases, it returns escaped markup and html entity codes.

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

just_like_good_vibes created an issue. See original summary.

rajab natshah’s picture

We hit this same bug building the UI Suite UIkit theme: on 1.0.0-beta7 / Drupal 11.4.7-dev, a node title themed with a wrapper prints the literal escaped tags in the page layout
instead of rendering. Matches the MarkupInterface (string) cast in PageLayoutPageVariant::replaceTitleAndContent() described here.

We worked around it in our theme with a page_title preprocess. We'll test MR !386 against our reproduction rather than open a duplicate issue - thanks to the reporter and to !386's author.

AI-Generated: Yes

pdureau’s picture

Assigned: Unassigned » pdureau
Status: Active » Needs review

Indeed, something wrong happened in #3618072: Placeholders and real render, in Canvas and Preview where this prop source has been changed to a slot source:

id: 'page_title',
label: new TranslatableMarkup('[Page] Title'),
description: new TranslatableMarkup('The Drupal Page title block (page_title).'),
- prop_types: ['string'],
+ prop_types: ['string', 'slot'],
tags: [],

This change is rendering PageTitleSource with the legacy page-title.html.twig, so hardcoded away the control of the display builder, which is exactly what we are fighting against by proposing Display Builder and the modernization of Drupal theming.

I am very sorry about such a situation. I will rebase first.

pdureau’s picture

pdureau’s picture

Assigned: pdureau » Unassigned
In a slot In a prop
Before #3618072: Placeholders and real render, in Canvas and Preview ⚠️ As plain text (but it was expected to be as a h1 hardcoded in Display Builder ✅ As plain text
After #3618072: Placeholders and real render, in Canvas and Preview ⚠️As page-title.html.twig ❌ As page-title.html.twig
Current MR: only Mikael commit ✅ As plain text ✅ As plain text
Current MR: with Pierre commit ✅ As plain text ✅ As plain text

Rajab, is it still OK for you?

rajab natshah’s picture

I agree to the last update on the MR
---
We are moving to having all dynamic - better not to keep some parts as static. even the default core title.

What I see that a Theme builder will decide to have a full HTMX support and then a full support for Display Builder.
As I'm testing that in UI Suite UIkit and Webtheme, Website and with some other setups
and a Web Dashboard too - with Display Builder

pdureau’s picture

I agree to the last update on the MR

So, OK for RTBC (except the little pipeline fail I ll fix before, of course)?

csakiistvan made their first commit to this issue’s fork.

csakiistvan’s picture

Assigned: Unassigned » csakiistvan
csakiistvan’s picture

@pdureau I pushed a fix to pipeline, please check.

csakiistvan’s picture

Assigned: csakiistvan » Unassigned
pdureau’s picture

Assigned: Unassigned » pdureau

Thanks. Will check

pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs review » Reviewed & tested by the community
In a slot In a prop
Before #3618072: Placeholders and real render, in Canvas and Preview ⚠️ As plain text (but it was expected to be as a h1 hardcoded in Display Builder ✅ As plain text
After #3618072: Placeholders and real render, in Canvas and Preview ⚠️As page-title.html.twig ❌ As page-title.html.twig
Current MR: only Mikael commit ✅ As plain text ✅ As plain text
Current MR: with Pierre commit ✅ As plain text ✅ As plain text
Current MR: with István fix ✅ As plain text ✅ As plain text