I have not liked the way that the post/page title in Wordpress 6 / Gutenberg is contained directly in the block editor. I have found many ways to remove it with filters and / or restyle it but ultimately what I seek is for the title to be included in the post-status panel of the sidebar instead. Certain posts/pages can still contain a post-title block but having this compulsory rendering in the editor is a distraction to more complex layouts.
It seems I am not alone in this view and there was this beautiful concept but nothing appears to have come of it. https://github.com/WordPress/gutenberg/pull/42352
Whilst some appear to share my irritation in the GitHub request I cannot see a plugin or pull-request to address us picky people available at this moment in time. So I have attempted to do it myself but node.js does not come easily and there is a dearth of documentation.
Using @wordpress/scripts I was able to create a custom panel in the side bar however I am struggling to find the relevant documentation to use it modify / update the post title. All I have so far is a rendering of the panel.
(function (wp) {
const { TextControl, PanelRow } = wp.components;
const { registerPlugin } = wp.plugins;
const { PluginDocumentSettingPanel } = wp.editPost;
registerPlugin("editor-setup-panel", {
render: function () {
return (
<PluginDocumentSettingPanel
name="setup-panel"
title="Setup"
>
<TextControl label={"Title"} value={""} onChange={(value) => false} />
</PluginDocumentSettingPanel>
);
},
icon: false,
});
})(window.wp);
This does not actually get the title as I cannot see how to do that and it therefore certainly doesn't update anything hence why onChanged is also not set.
Ideally it should also appear above the status panel but I can't see how to change it's position either nor have it open by default.
Is there any documentation on this anywhere.
EDIT (solution 1)
The basic plugin that adds title to sidebar is complete. It also removes the generated title from the editor (if you want it back then use a Post Title block - as it should have always been).:
Edit (pending solution 2)
Implementing the full sample seen here has proved more challenging. I did recreate it entirely in a separate panel using PluginDocumentSettingPanel but certain attributed like URL are not exported from @wordpress/edit-post at all. Even copying the code listed on the Gutenberg repository will not render two of the components needed to fully recreate it with additional attributes.
Therefore, don't recreate the panel. Use the slot provided in PluginPostStatusInfo and add the featured image, title and excerpt here. Yes it's not in the right position however, the slot is not relatively positioned which means we can reposition it. WorkInProgress but see the red section in the image.
I will release these all as plugins in due course. Having reviewed the document guide it's just not very interesting to do it now as I'm in the middle of a project. However, I know that (contrary to the abundance of interest in the stackExchange Wordpress community over gutenberg, the title sidebar feature is actually in high demand. If someone would like the code and go through the plugin formalities they are welcome to it.
EDIT 3 Full Solution
And there it is, fully completed and fully functional. You can see both versions in this screenshot. Now to work out how to submit plugins (never done it before) to wp and I'll post them as the answer once they are available.