-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post title: if a name isn't set in the creation process, the page title isn't visible in the editor #67539
Comments
isn't this expected though? I believe not having the title is something that many users are asking for. |
This looks like a bug to me. In Twenty Twenty-Five or Twenty Twenty-Four, there is a template called "Page No Title". When you create a new page without a title, somehow this template is automatically applied: I think creating a page with an empty title is generally when we haven't decided a title yet, and doesn't mean applying a page template that has no title. |
Hi everyone, There is an option in the edit section to rename the page. Using this, you can add the desired name to the page. I believe this option can be helpful in such scenarios where the template chosen is 'Page No Title'. Please find the attached video for reference. Screenshare.-.2024-12-04.11_27_20.AM.mp4 |
I found another problem. When creating a page in the site editor, enter the title cb177f19a0fe0203f300c6a941e4e648.mp4The problem here is that the template applied by default changes depending on the type of template the theme has, or the title when creating a page. Here is the process to create a post, but I don't understand why this behavior occurs. |
If you have a page with the slug "apple" and a custom page template named page-apple, that template will be used The default in WordPress for pages that has no title is not "No title" but "Untitled". My guess is Gutenberg may be using this wrong? |
I see, thanks for letting me know. So does that mean that what's reported in this issue is actually the correct behavior? |
If users are finding it unexpected, then it is not the correct behavior, even if WP is mapping the template and page slug correctly. |
After further investigation, it seems that the classic editor applies the default template regardless of the title or slug, so the behavior in Gutenberg seems odd: 83d10410a17f80787fca70d11bc34b87.mp4 |
Is the slug no-title? I think the slug is I did not know that the classic editor even understood HTML templates, they do not have the page header that the PHP templates do. |
I was able to find some more time to test this. My suggestion would be to try to always create a unique slug when there is no title, because there could be many more themes with these types of page templates. |
Thank you all for digging in here! Just to recap, I don't see this as expected behavior when comparing it to the original add new page flow. I don't always want to title things when getting started and I don't think I'm alone there. I'd expect it would use the default template, unless I manually changed it, as I think it's a big leap for one to expect that not including a title would fully change a set template. |
As @carolinan mentions, this has been the default behaviour in Core since 4.7. If Gutenberg wanted to override this, there are filters in get_query_template that could work.
Yeah. It's a bit inconsistent though, as if you create a second page with no title, it uses the default template. 🤔 Updating the default title text (Currently 'No title') doesn't seem robust as there's the possibility of matching with anything you put there. Maybe we could override default behaviour when creating new pages like this? |
Let me summarize what I understand from this isue.
Are these correct? |
So when the second untitled page is created its slug is All the I still think that, when the page is created, the editor should just avoid using a generic slug and use the post id if the user does not enter a title. What is shown to the user in the title fields can still be a readable label. |
And in cases when it is not untitled, but match an existing template, perhaps help the user with a notice? Plugins may still rely on this working as it has done, historically. |
I think this auto-matching based on slug behavior is very arguable to be honest, that said, I think we should at least disable it entirely for pages/posts with "empty titles". So my question is why "pages without title" are being assigned the |
I think we could safely delete this line:
It will fallback to the default behaviour we see in the post editor, and generate a unique slug using wp_unique_post_slug - usually a page with no title will be assigned What do folks think? |
I think so too 👍 |
I'll throw a PR up. |
Titling this for the Post Title block since it's the same as for the Page Title. Using Gutenberg nightly (Version 19.9.20241203) with WP 6.7.1 and TT5, I found that if I don't name a page when creating one, a post title block is not rendered in the template for me to then edit:
no.page.title.without.naming.page.mov
Replication steps
The text was updated successfully, but these errors were encountered: