gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Cannot open in new window for links and from pictures

Open Biobobski opened this issue 8 years ago • 6 comments

I am trying to add a link, when i click open in window button it just turns the picture below blue and doesn't save the option the only way round it is to move the text below the image, add the option then move back up again.

There is also no option to click a picture and open in a new window

Biobobski avatar Aug 10 '18 15:08 Biobobski

I tried adding a link above an image and found it worked sometimes and other times it didn't. Here is a screengrab. First the link button didn't seem to work, then when I tried to click in the URL field, nothing happened. Using Gutenberg 3.5.

adding a link above an image

I also can't see a way to open image links in a new tab.

linked image - no open in new tab option

Other than this roundabout method:

Add an image in a block and link it.

Switch from the Visual Editor to the Code Editor and manually insert a target="_blank" to the <a> tag in the image block.

image as custom html opening in new tab

Then switch back to the Visual Editor. You'll see a message This block has been modified externally.

Choose Keep as HTML. It mangles the HTML Preview, though the image is the correct size on the front end.

modified image link preview

abrightclearweb avatar Aug 10 '18 19:08 abrightclearweb

Thanks for reporting this @Biobobski. Both of the issues mention look to now be resolved, so I'll close the issue if that's ok with you.

Here's a gif showing a link being added above an image block and being set to open in a new tab: link-above-image

Image blocks now also have an Open In New Tab option in the sidebar.

Do let me know if you can still reproduce them and I can look into what the issue is.

talldan avatar Dec 11 '18 08:12 talldan

I'm having this same issue. The image has a custom link, but when it is clicked outside the editor (in either preview or published), a giant lightboxed image pops up.

When I do this 1

This happens 2

Instead, it is supposed to link to this page, just like the text below http://ash-creates.com/xpand-shoelaces-rebrand/

ashloff avatar Dec 13 '18 00:12 ashloff

Hi @ashloff - are there any plugins you're using that might be causing this issue? I don't think there are any lightboxes in Gutenberg.

talldan avatar Dec 13 '18 00:12 talldan

That was it @talldan ! I disabled the plugins and found that one of them was causing a lightbox to appear. Thanks.

ashloff avatar Dec 13 '18 07:12 ashloff

Hi. Not quite sure if this counts as an issue or a request, but I think it is related to this post. When using the block type Gallery in a post I can choose if the full size source image shall be opened if a user click the thumbnail in the gallery. But I want it to open in a new tab or in a new window, not in the same window. I miss something like a check box (open in new tab) in the block admin panel. Or is there already an easy way to do this, that I have missed? bild

gloofer avatar Aug 18 '19 16:08 gloofer