Gutenberg: Add option to set as feature image to image / cover block

Created on 9 Feb 2019  路  12Comments  路  Source: WordPress/gutenberg

When creating a post, there is a real disconnect between the content of the post and the elements in the sidebar. For this reason, I and am sure others, forget to set a featured image. Features images are useful for list pages like archives and for plugins like yoast to pick the image that best reflects the content. It feels odd that you could have a post with many images, in form of image, cover or gallery blocks and not the correct featured image.

Describe the solution you'd like
Add a button to the image / cover blocks, called "set as featured image". This is just a helper that sets the current image a feature image. It could also save data on block to say it is feature. This could help themes work on the current featured image and stop it being displayed twice at the top of a post.

Describe alternatives you've considered
Add a new feature image block, but this just feels like a copy of the current image / cover blocks.

Needs Dev [Block] Cover [Block] Image [Feature] Document Settings [Feature] Media [Priority] Low [Type] Enhancement

All 12 comments

Yes, I second this idea, particularly because once I add an image, even if it is the only one i still have to add it again in the sidebar. A button to set featured image for image media blocks would be nice. I wonder if it could be something that blocks can opt into like provide featured image or something.

This is a very good idea!

Perhaps something like this:
Featured-image-image-blocks

Adding the Set featured image checkbox to the Image/Cover block.
The image will also need to automatically be added to the Document Featured Image section.

In my head, I had a icon button in the toolbar next to the replace button.

The toolbar is used for the most important features and most used icons.
The sidebar are for the less used options.


EDIT:

Another example of the Image Block. I added the checkbox first and the Set featured image text after.
Image-Block-Set-featured-image

Here is an example in the Cover Block. Where I have added the Featured image checkbox on the bottom right.
Cover-Block-Set-featured-image


Another option I have not explored is adding it into the ellipse (3 dot menu drop down) menu for all Image and Cover Blocks. That would hide it further away though. Making it harder to discover.


NB. When a user clicks to use image as featured (Image Block or Cover Block) the image needs to automatically be inserted into the Featured image box in the Document settings.

Here is another way complementary of automatically adding a featured image.
Notice the checkbox and text below the Featured Image box. It adds a general way to automatically add the first image as featured.
Perhaps there could be an option under document Options. So that it would be by default checked in the Options screen.

Auto-add-first-image-featured

EDIT:
We could actually have "Automatically add first image as featured." checkbox pre-checked.
As it would make the first image added to the document automatically added it to the "Set featured image" box. If the user forgets to add a featured image it will already be added because of the pre-checked checkbox.

If the user decides to add another image as featured then the "Automatically add first image as featured." checkbox would automatically become unchecked.

Auto-add-first-image-featured

I don't agree that adding something to the blocks is the way to do this. Perhaps just enhancing the dialog you get when you click on the sidebar Set Featured Image, to include the images already in the post.
Making it part of the blocks sort of implies that they are related, when actually they are not, and the theme or plugins will do whatever they do with featured images separately from the block in the post. I can imagine that users might add an image, click your new little button, then change the image and presume that the featured image would change also.
Keep the content separate from the other attributes that describe the content (taxonomies, featured image, post meta, date, visibility, etc.)

Here's how my EditorsKit plugin is doing the "Set Image as Featured" on image block.

set-image-as-featured

I like @joyously 's proposal to enhance the main featured image sidebar control. Adding it to blocks is also nice since it is in the context: I am already having the image that I want selected. Maybe both should be explored.

I wonder if featured image is not a variation of the image block with the featured attribute set to on.

The proposal to quickly set an existing image in the post to become the feature image is understandable. Although, I too agree that I would not want them to become tied together in a way that might confuse the user.

Keeping these separate visually and interactively also keeps them separate conceptually. Listening for more feedback sounds good here, but I'm in favor of keeping these two interactions separate for now.

I would suggest adding a checkbox below the existing "Set featured image" box that says something like: "Automatically set first image as featured". Having a checkbox there it becomes associated with the existing featured image box. Keeping the feature in one place.
https://github.com/WordPress/gutenberg/issues/13795#issuecomment-636787215

EDIT: It will be off by default. Leaving it up to the user to turn it on.

NB. I would suggest a code snippet to add to the functions file to automatically have the checkbox checked. http://www.indexwp.com/automatically-set-featured-image-wordpress/

That's not bad at all. It keeps the interaction tied to the featured image component. Maybe the wording can be adjusted to say... "Add the first image as featured."

  1. I agree keeping the interaction tied to the featured image component is optimal.
  2. I also think it should stay on the document panel as well. If it were an option in the image block it would throw errors in the editor flow process a lot of the time since an error message is often thrown when an image is not the right size for default featured images.
  3. Screen Shot on 2020-06-18 at 07-49-25
  4. This setting could be a toggle on the document panel in the featured image component but it can cause issues for users in the archive page presentation or view with duplicate images depending on the layout of their pages/posts... so, for this reason, I do not think it should be "ON' by default.

I do not understand why the editor's kit example above does not show the error unless the image in that example is already sized perfectly for the featured image...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

youknowriad picture youknowriad  路  3Comments

cr101 picture cr101  路  3Comments

ellatrix picture ellatrix  路  3Comments

wpalchemist picture wpalchemist  路  3Comments

moorscode picture moorscode  路  3Comments