-
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 option to set as feature image to image / cover block #13795
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 |
In my head, I had a icon button in the toolbar next to the replace button. |
Here is another way complementary of automatically adding a featured image. EDIT: If the user decides to add another image as featured then the "Automatically add first image as featured." checkbox would automatically become unchecked. |
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. |
Here's how my EditorsKit plugin is doing the "Set Image as Featured" on image block. |
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. 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." |
Also associated: Featured Image: Automation and improvements |
I'll start exploring adding a toggle for the cover block that pulls the featured image if one is set. |
Looking into this, considering the advancements we have had from the work on entities, it seems @jasmussen has a great point in solving this via the media replace flow component. It would automatically make the featured image available as a source for many blocks and it's also pretty intuitive as a workflow. |
We could also maybe start with it as part of the replace flow and then the URL can be tokenized later if it makes sense? |
Some questions I stumbled upon while researching this:
|
CC: @dmsnell as I think you've been looking into some token stuff. |
Thanks @jasmussen. While we don't have working code to my knowledge, the idea in proposal is that we can create a special URL or token of some kind that indicates the source of an image is "the featured image" of the post in context (could be on a page itself, could be the current post in a query loop). This is opposite of my understanding of this PR, which is to instead say, "set the post's 'featured image' to be this particular image." This is conceptually much simpler. |
If this is simpler, would you mind if this one landed as a small improvement without the need for tokens? I know I mentioned it initially, but after mulling it over, I have a feeling that tokens in URLs might make for a somewhat tricky UI, and that tokens for example in a date block might be more intuitive as a starting point:
What do you think? |
A thought.... |
Cool! Going back to shortcodes? This really underscores the need to keep the content separate from the extra stuff that describes it, like taxonomies and featured image. |
Not at all, if my understanding is correct. Specifically, that this feature request has nothing at all to do with tokens or indicating that when rendering, a given image should show the featured image for a post. In my understanding this feature request is specific to the image and cover blocks and amounts to a shortcut function: "go ahead and set this one as the featured image for the post."
Just my own two cents here: that seems like a double-edged sword since I think I've seen plugins and themes that use their own methods to pick a featured image (when none is already set). Maybe it's a good idea to force-choose a featured image 🤷♂️ - probably worth a different issue. Also worth a different issue, while we're discussing it, is why not present a drop-down on the featured-image selector that not only lets you upload or pick an item from the media library, but shows a small thumbnail grid of all the images currently in the post. That could get the featured image picking closer to the task at hand. It would work well with a shortcut from the image block. ❓ How hard would it be to realize this feature request as an extension that we can apply to the block vs. hard-coding the behavior inside the block? Could we write out the behavior as a hook and inject the button into the block's inspector or toolbar? |
As @draganescu made the PR for "Makes cover block dynamic and adds featured image binding" and went ahead and closed this issue. Is there something we should move over to a new issue that has not been dealt with here? There is also this issue: Both issues are closed but fallback featured image has not been dealt with yet, so that should be reopened. (Commenting there as well.) |
We now have an icon in the Cover block which we can click to add the Cover block image as a featured image. We do not yet have this new feature (icon) added to the Image block. @draganescu Andrei. Let's get the same feature added to the Image block. Regarding Featured images. Check out this article at WP Tavern: |
Un-assigning @draganescu as I think this issue is waiting for someone to pick it up. |
Just checking if we still need this given it is possible to insert a 'Featured Image' block? |
I don't know that it needs a separate issue, but there are some things we need to explore in 6.4 around connecting refrences. For starters it will mainly be colors (I want to use the text color for my background, and the background color for my text), but images may be a part of that as well. It needs a generic solution that would also work for plugin blocks, and media and text. |
@jasmussen what exactly is left for this issue to be closed? #41704 seems to point to not wanting featured prop of image block. What else? |
I'm actually happy to close this issue, simply because its use case will likely be addressed by the ref/token system, and with 5000+ issues it's only good to consolidate! |
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.
The text was updated successfully, but these errors were encountered: