Gutenberg: Media & Text block: Option to link media.

Created on 3 May 2019  路  14Comments  路  Source: WordPress/gutenberg

Is your feature request related to a problem? Please describe.
It would be nice to be able to link the media in the Media & Text block. Similar to the single image block.

Existing Media & Text block:
Screen Shot 2019-05-03 at 18 19 56

Single image block:
Screen Shot 2019-05-03 at 18 21 03

Describe the solution you'd like
A standard single image linking method added to the block.

Describe alternatives you've considered
Well one could probably go in through HTML and add a link but that is not very intuitive.


Btw we need a consistent way to handle images in all blocks.

Needs Design Feedback [Block] Media & Text [Status] In Progress

Most helpful comment

Yes, I think we're set, will assign this to me and take a stab at it. ( cc @mapk )

All 14 comments

Yes please!
Just logged my first client confusion just because this.

There is yet another consistency issue with the Media&text block:
One can simply not find the option "edit as html" for this block type, neither for the image inserted by this block:
image

The only way to edit the html of this block type is to edit the whole post/page in html which can be overwhelming. But even doing so, the link inserted via html will be cut out, probably by some verification in the background. That means currently there is no way to add this ability to an image in a media&text block.

I've encountered this a few times. It's a common use case to want to link that image, and the only way possible right now is to use HTML. It would be great to see the link option added!

So what we need right now is a dev that is able to add the image link icon to the toolbar.
So we go from this:

Screen Shot 2019-08-23 at 12 46 59

To this:
Media-text-block-link-image

Perhaps this is something that Andrei can take a look at? Or someone else.
@draganescu

I guess here the main concern is that the block is Media + Text, not Image + Text. Video files are not usually linked and I feel as if folk use this block "improperly", instead of using a floated image block and a heading.

I'll label it accordingly and wait it out :)

I guess here the main concern is that the block is Media + Text, not Image + Text. Video files are not usually linked...

We could have the Link Settings panel only available if mediaType is _not_ video.

I've created a solution for this issue few weeks ago on EditorsKit plugin : https://wordpress.org/plugins/block-options/ . Here's how it works :

Screen Capture on 2019-09-25 at 01-05-53

My implementation is using the similar existing way of adding link on Image Block. Then added few link options for "rel" attributes. The link toolbar will only be available when media type is image.

@phpbits that feels pretty good. @draganescu what do you think about just showing the link option for images as in the EditorsKit plugin? ... without all the extra link options though...

@mapk Thanks! I've spiced up the Media and Text Block a bit last few weeks. I've also added the card-like layout aside from left and right image position ;)

Edited:

Please make sure to check this issue as well : https://github.com/WordPress/gutenberg/issues/17556 . I believe the images will be linked to sponsored urls as well. So this is related. Thanks!

Yes, I think we're set, will assign this to me and take a stab at it. ( cc @mapk )

@mapk should we also include the Media File and Attachment options that the image block's link control provides?

This is now testable in #18139

Having a similar issue as described at the start of this post. Is this feature out of testing and live on Wordpress.org/.com? Would love to be able to use it!

Howdy @Clearly5000 it is almost ready, goign through reviews right now, it will be testable as soon as #18139 gets merged in master.

Great news, thanks!

Was this page helpful?
0 / 5 - 0 ratings