Skip to content
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 lightbox effect doesn't work for image blocks #3450

Closed
rsmith4321 opened this issue Oct 5, 2019 · 16 comments · Fixed by #3460
Closed

Add lightbox effect doesn't work for image blocks #3450

rsmith4321 opened this issue Oct 5, 2019 · 16 comments · Fixed by #3460
Labels
Bug Something isn't working
Milestone

Comments

@rsmith4321
Copy link

Bug Description

If an image is inserted using the block editor image block, and under AMP Settings the Add lightbox effect is selected as on. The image is not loaded in a lightbox when clicked.

Expected Behaviour

The image should be loaded in an amp lightbox when clicked.

Steps to reproduce

The first 3 images on this page have Add lightbox effect on with no effect. https://www.ryansmithphotography.com/myrtle-beach-wedding-photography-prices/

Screenshots

Screen Shot 2019-10-04 at 11 14 46 PM

Additional context

  • WordPress version: 5.2.3
  • Plugin version: 1.3.0
  • Gutenberg plugin version (if applicable):
  • AMP plugin template mode: standard
  • PHP version: 7.3
  • OS:
  • Browser: chrome
  • Device: MacOS Desktop

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@westonruter
Copy link
Member

@rsmith4321 Do you have any filters on images like you had for galleries in that other issue?

@rsmith4321
Copy link
Author

As far as I know there are no filters or special settings on my site for images. Does this work on other sites? I just assumed it was something that hasn't been looked at yet similar to the gallery lightbox issue.

@westonruter
Copy link
Member

@kienstra Would you please investigate?

@kienstra
Copy link
Contributor

kienstra commented Oct 6, 2019

Sure, @westonruter!

@kienstra kienstra self-assigned this Oct 6, 2019
@kienstra
Copy link
Contributor

kienstra commented Oct 6, 2019

Thanks, I also saw this

Hi @rsmith4321,
Thanks for bringing this up. It looks like this is a valid bug.

As a quick workaround, does removing the link in the Image blocks help?

image-block-link

I could reproduce this issue when the Image block has a link, but the lightbox looks good when it doesn't.

I'll look at a code fix in the plugin, but maybe that workaround will help in the meantime.

@westonruter westonruter added the Bug Something isn't working label Oct 6, 2019
@rsmith4321
Copy link
Author

Yes this works. Is there an seo disadvantage to no longer linking to the original image? Also, on a desktop I want to target these type of images with cursor:pointer css since the cursor no longer changes on hover. How can I target only lightbox supported images with css? Or perhaps this is something you can add.

@kienstra
Copy link
Contributor

kienstra commented Oct 7, 2019

Hi @rsmith4321,

Yes this works.

Thanks, that sounds good. Of course, I'll also work on a fix in the plugin for that.

Is there an seo disadvantage to no longer linking to the original image?

Hm, I'm not sure.

Also, on a desktop I want to target these type of images with cursor:pointer css since the cursor no longer changes on hover. How can I target only lightbox supported images with css? Or perhaps this is something you can add.

I'll look at this also.

@kienstra
Copy link
Contributor

kienstra commented Oct 8, 2019

Hi @rsmith4321,

Also, on a desktop I want to target these type of images with cursor:pointer css since the cursor no longer changes on hover. How can I target only lightbox supported images with css? Or perhaps this is something you can add.

This worked locally, though maybe you'd want to add selectors so it doesn't apply to all <amp-img> in the document:

amp-img[data-amp-lightbox] {
	cursor: pointer;
}

Images that have that 'Add lightbox effect' toggle on will have a data-amp-lightbox attribute:

data-amp-lightbox

@kienstra
Copy link
Contributor

kienstra commented Oct 8, 2019

Request To Test

Hi @rsmith4321,
Thanks for your help with testing these PRs.

Could you please test #3460, which should fix this issue? It should now be possible select links, while still getting the lightbox (though the links won't appear on the front-end):

image-add-link

@kienstra
Copy link
Contributor

There's probably no need to test this now until there's a response on ampproject/amphtml#25021

@westonruter
Copy link
Member

It looks like the direction is to stop using amp-img-lightbox in favor of using amp-lightbox-gallery. See ampproject/amphtml#25021 (comment)

@kienstra
Copy link
Contributor

Sounds good, thanks for 'bumping' that issue. I'll look at using the amp-lightbox-gallery for this.

@rsmith4321
Copy link
Author

Sorry I haven't had time to test but it sounds like you are going a different way anyway. The amp-lightbox-gallery lightbox seems a lot more full featured for example the amp-img-lightbox doesn't even have a close icon to indicate how to exit the lightbox. Thanks!

@kienstra
Copy link
Contributor

kienstra commented Oct 14, 2019

Sure, no problem in testing, this was dependent on the amphtml issue anyway. I'm going to work on converting this to an amp-lightbox-gallery.

@kienstra
Copy link
Contributor

Request For Testing

Hi @csossi,
When you can, could you please test this, using the steps to reproduce here?

Thanks, Claudio!

@csossi
Copy link

csossi commented Oct 28, 2019

Verified in QA

@csossi csossi removed their assignment Oct 28, 2019
@westonruter westonruter added this to the v1.4 milestone Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants