Open paaljoachim opened 10 months ago
Linking to Tracking issue: https://github.com/WordPress/gutenberg/issues/51132
As a web user, often it's expected that clicking on images in a blog post will open larger. In using Featured Image, it would be highly preferrable to have a native control for enabling this ability, rather than modifying the PHP.
I see a potential opportunity to rethink the implementation of the Featured Image block entirely. Instead of creating and maintaining a separate logic for the Featured Image block, we could leverage the existing capabilities of the Core Image block.
Proposal
Transform the Featured Image block into a wrapper for the Core Image block. By using the Core Image block as an inner block within the Featured Image block, we can take full advantage of the advanced features and ongoing improvements that the Core Image block offers. This approach minimizes redundant code and maintenance while enhancing the functionality and user experience of the Featured Image block.
Benefits
Unified Functionality: The Core Image block already supports various features like lightbox expansion, aspect ratios, and conversion to other block types (e.g., Cover Block). By embedding the Core Image block, the Featured Image block inherits these features.
Consistent Updates: As enhancements are made to the Core Image block, the Featured Image block will automatically benefit from these updates, ensuring consistency and reducing the need for duplicated effort.
These thoughts also stem from the fact that in order to implement lightbox on the Featured Image block, a lot of the logic already written for the Image Block would have to be duplicated, or we would have to find a good way to share it.
This is a high-level comment as I'm not too familiar with the interactivity API or the featured image block 😅
we could leverage the existing capabilities of the Core Image block.
I really like this idea - it makes sense to use the Image block wherever possible to avoid duplicating code/logic. I'm not sure if there are any hidden limitations or reasons why this hasn't been done before.
cc @artemiomorales for any input on this approach to sharing the lightbox logic via using the Image block as any inner block 🙇
Just wanted to note that I would love this feature. On my site currently, the featured image block for the single posts template is set to full width with cover as the scale. This sometimes results in the image being partially concealed. Having the ability to click on it and view the entire thing would be really nice.
My initial wish was for a switch setting identical to "Link to Post" that just toggled "Expand on Click".
+1
What problem does this address?
I went ahead and added the Featured Image block to the Single Posts Template.
I made the image so high that it would be possible for people to see the contents and read the words if needed.
If I had made the image small it would not be possible to see the contents or read the words.
What is your proposed solution?
Add "Expand on click" (lightbox) also to the Featured Image block.
So that one can add a smaller image and still making it possible for a user to click the image and see more details of the image.
@artemiomorales