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 optional links to individual gallery images #580

Merged
merged 20 commits into from
Jun 25, 2019

Conversation

richtabor
Copy link
Contributor

@richtabor richtabor commented May 31, 2019

This PR enables users to add individual links to gallery images within our gallery blocks (a common support request from WordPress.org).

There's still a few loose ends:

  • Add a "Custom" value to the blocks' Link Settings PanelBody, which then reveals the imageLink UI
  • The new link UI within the Stacked block is not working 100%
  • The URLInput empty upon transforms, even if the current image's custom link is applied
  • Carousel does not currently support links, do we remove the UI on Carousel - or work in support?

Preview:

ScreenFlow

@richtabor richtabor changed the title Add optional links to individual gallery images WIP: Add optional links to individual gallery images May 31, 2019
@richtabor
Copy link
Contributor Author

The Custom Link UI only displays if "Custom URL" is selected via Link Settings:
ScreenFlow

@richtabor
Copy link
Contributor Author

This only works with the Stacked and Masonry blocks, as the carousel does not support links at all (currently).

@richtabor richtabor changed the title WIP: Add optional links to individual gallery images Add optional links to individual gallery images Jun 7, 2019
Copy link
Member

@jrtashjian jrtashjian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, 1 note but no change required.

src/components/block-gallery/gallery-link-settings.js Outdated Show resolved Hide resolved
@richtabor richtabor requested review from jrtashjian and removed request for EvanHerman June 15, 2019 15:40
@richtabor richtabor added this to the 1.11.0 milestone Jun 15, 2019
@richtabor
Copy link
Contributor Author

Looks ready to go!

@richtabor
Copy link
Contributor Author

@jrtashjian Should we wait to merge this before the Jest tests?

@jrtashjian
Copy link
Member

@richtabor we will need to implement integration tests to test this out, which are going to come at a later time. Let's go ahead and merge this one.

@richtabor richtabor merged commit 7b59e51 into master Jun 25, 2019
@richtabor richtabor deleted the add/gallery-image-links branch June 25, 2019 14:14
@benjaminluoma
Copy link

Is there a plan to add this to carousel blocks as well?

@richtabor
Copy link
Contributor Author

Is there a plan to add this to carousel blocks as well?

Not immediately, though that's something I do want to look into. If I recall correctly, the big issue was figuring out how to properly navigate the carousel within the editor to add links - as currently, if you let off of the carousel (for example, to click into a URL field for an image), it resets the carousel instead of keeping it in place. If you have any ideas, I'm all ears :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants