-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add title should be optional #1914
Comments
I'm really not sure titles should be a optional, at least for now. Defining something as a block suggests something as optional, whereas a title really isn't an optional field (sure, it can be empty, but WordPress will still append protected/ private strings & themes will assume a title to exist). Additionally, titles are used to reference posts/ pages within wp-admin.
Switched for what? The theme controls the output of the title, so I'm not sure why there are more than two options here (title or no title)
Nice idea, but I again wonder if this should be controlled by the theme. E.g. a theme could hook into the block parsing process, in order to add the title after the first cover image (or at the start if no cover images exist). I have taken a similar approach with ACF flexible content in the past, without too much difficulty. This also has the bonus of forcing front-end consitsncy. Leaving the title position under theme control also means legacy themes using -- That said, I do see an opportunity here. If the title was a block that could never be deleted (i.e. not optional), then it could add controls to the post setting sidebar. These could be used by themes to give various output options (above post, below cover image). Core could also have a "hide from front-end" checkbox. Then all that is needed is a new I suspect this is better left until Gutenburg is more mature though - as it stands, titles are in no worse position than core is today. |
Titles do not seem optional to me either - how else would you know which post is which in the posts overview? But hiding the title block seems useful. Because when I put a cover image in my post, it annoys me that the title block is still there. The whole purpose of a cover image block, it seems to me, is to jazz up a post title. A featured image and title in one, basically. What other use would the cover image be if you still have to put a regular title above it (or below it)? Or maybe those two blocks could be merged? That's what I would prefer. Right now the title block doesn't have any properties in the inspector anyway. |
Titles are optional, for example, in the “status” posts. Take P2/O2 as an example: Behind the scenes, O2 will grab the first 5 words from the body to then use as the post title, for the purpose of post lists I think: https://github.com/Automattic/o2/blob/ee615502667df01ead93853be4f56a97f63fed3f/inc/write-api.php#L89-L95 |
Yes, titles are totally optional in WordPress currently. The first few words of the post content will be used for the post title if the user doesn't enter one. For those of us who adopted post formats (for better or worse) get by without titles on the status format. Perhaps this is more of a design consideration at the moment. Currently it looks as though the title is part of the content within gutenberg as it shares the block design language. So one of the first things I did was tried to format it in the same way as any other block. Really it doesn't have to be part of the content, some themes may not even show it (e.g. pages, custom post types), or use it in the On the other approach that 'the title is an essential piece of the content' then it should have comparable functionality to other blocks for formatting. In terms of switching, comparable ones would be text, heading and cover image. Going down this route we should be able to make some pretty good guesses as to what the title of the post is based on blocks used and how it's written. |
I agree that titles should be optional. |
If I just post an image on my photoblog, it doesn't necessarily need a title. I'm also a +1 for title remaining optional. |
A fix for this should also explicitly check if the current post type has declared that it supports titles, and hide the title block if it hasn't. |
Yes, checking for the post type would be a simple update. Though it wouldn't cover cases like aside / status. This will be better once we can look beyond the post_content area so we don't have to chase what the front end might represent (which depends on the theme). |
@ChemicalSailor thanks for the exploration. I think this though only possibly works on larger screens. What would happen on smaller ones? I would caution against us adding to the top section as this mixes types. The title is linked to the content not the interactions. |
@karmatosed thanks for your insight, I can't argue against that. Perhaps there is some compromise solution. I still think there needs to be some extra separation, at the moment the title looks like an inherent part of the content. |
What about if we simply add an ellipsis menu item to delete the title? |
That's a great idea I think. |
I wouldn't make anything custom for title until "title" is itself a block. Which seems like a task for stage 2 of Gutenberg. At that point you'd be able to move/delete the title block and combine it with post date, by-line, etc. |
It seems there's a wide agreement that we making the title a block that was, perhaps, inserted by default but removable, would be a nice enhancement. But it's also unlikely to happen in phase 1 of Gutenberg. As such, I'm going to close this for now, we can always reopen. |
Position and display of titles are often controlled by the theme and separate from the content. Gutenberg assumes the title is part of the content and displays it that way. The title should/could just be an attribute. If my theme wants the title in the content, I will use an h1. I like the suggestion of a title block that is added by default (with that functionality being disable-able via |
Add title +1 to make this easily removable PLEASE!! We build complex, bespoke themes that often have complex title options built for each project (such as 'type of title', background images, sub titles etc). In it's current form the Gutenberg 'editor' assumes that the title is 'floating' above 'content' - so this suits basic sites, I get it. However, this doesn't suit the kind of sites that many professional agencies build - we should have the option to remove this (via code - not by a user of-course!) and dare I say a hook to insert 'above Gutenberg' so we can logically put our own 'header options' above the main editor, rather than pretty much being forced to relegate such options to the sidebar area. I'm not bashing Gutenberg - there's a-lot I like about it (really!!), but right now this is a big blocker for us for adoption. |
There's also the simple issue of screen real estate. The title just takes up so much space in the editor. It would perhaps be best if title and slug were, optionally, a metabox. |
Good news on this as a follow-up: see #11929 |
That's quite a different issue. Many themes don't want to remove post type support for Title; they just don't want the title to be in the body of the editor. |
@swinggraphics - hmmmm, not sure on that one buddy - maybe we are coming at this from different angles?! Correct me if I'm wrong but actually by using the code example in #11929 will achieve removal of the post title field in the post editor admin UI (in Gutenberg) - which was the original issue request. Also, in my testing, the title isn't going into the post content on page output - it is rendering out separately as defined in my theme exactly where it should - and separate to the post content/body. Once removed, there would be nothing stopping you creating your own block or sidebar metabox option to either add your own custom title field if required + more advanced title/header options - which is where my interest lies in this issue. Bear in mind that remove_post_type_support() can be used on both in-built post types and custom post types too without conditional tests (first param is post type) - so VERY easy to do even for beginner developers. |
OP wanted titles optional on a per-post basis, so remove_post_type_support isn't a solution for that, either. |
i also think the title should be optional because of design reasons. maybe give an option to hide the title. |
Nice solution, @ChemicalSailor. That would be nice and makes more sense to me. Maybe it could optionally be placed near the permalink panel. As it is now, it just seems like it's irrevocably part of the page's topmost content, which isn't always the case. It might cover other use cases with a setting that allowed other blocks to come before the title. I ended up using ACF for this:
There's still the problem of h1 being blocked from the inline controls: |
Title can be moved into the sidebar, above the "URL slug" field. It feels like a natural location fo the title and it will also combine it with other editor unrelated elements like Featured Image and Excerpt in posts. It would be awesome to let the blocks begin from the top, without margins or paddings, for example, for the Cover or other similar blocks usage. |
Not all posts will have titles. A lot of my users tend to write status updates so a title isn't required. The title should really be just another block rather than it's own entity so it can at least be switched or indeed be placed below a cover image block
The text was updated successfully, but these errors were encountered: