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

Jetpack Tiled Gallery: Link To differences between Web and Mobile #4136

Closed
illusaen opened this issue Oct 20, 2021 · 9 comments
Closed

Jetpack Tiled Gallery: Link To differences between Web and Mobile #4136

illusaen opened this issue Oct 20, 2021 · 9 comments
Labels
Tiled Gallery block Issues with this label will automatically appear on the project's board [Type] Discussion

Comments

@illusaen
Copy link
Contributor

illusaen commented Oct 20, 2021

There are differences between the web's implementation of "Link To" setting (has options attachment, media, and none) and the mobile implementation of "Link To" (pulls up a modal URL search sheet where you can add a URL that opens a browser window/tab when block is clicked.)

We need to figure out which one of these we want for JTG and implement it.

Related:

@guarani guarani added the Tiled Gallery block Issues with this label will automatically appear on the project's board label Oct 20, 2021
@guarani
Copy link
Contributor

guarani commented Oct 25, 2021

In offline conversation, @kyleaparker said it would be fine to implement the Jetpack Tiled Gallery's the same "Link to" functionality found currently in the Image block. That's to say, it should open the "Link to" modal allowing the user to enter a URL or search for a post, page, etc.

@guarani
Copy link
Contributor

guarani commented Oct 25, 2021

I created #4156 to capture the requirements for the block's "Link To" functionality and will close this issue now that we've reached a decision on what to implement.

@guarani guarani closed this as completed Oct 25, 2021
@guarani
Copy link
Contributor

guarani commented Oct 25, 2021

@illusaen, one aspect of this I hadn't considered previously was compatibility with the web. If we borrow the Image block's behavior, users will be able to set a custom link on mobile, however on web they will still only see the "Media File", and "Attachment Page" options, so there could be a compatibility issue.

Looking at the Image block, its options are Media File, Attachment Page and custom URL. On mobile, only custom URL is currently supported.
The block's linkDestination attribute changes accordingly:

  • "linkDestination":"none"
  • "linkDestination":"custom"
  • "linkDestination":"media"
  • "linkDestination":"attachment"

For each of these options, except the first, the actual link is stored in an <a> tag that wraps the image.

Back to the Tiled Gallery, its equivalent attribute is called linkTo here and its options are:

  • (nothing, when no link is set, unlike linkDestination, which has a value of "none" when no link is set)
  • "linkTo":"media"
  • "linkTo":"attachment"

Here I see that the link for each option is applied to each image, again via a <a> tag.


Since the Tiled Gallery on the web doesn't support custom URLs, our options seem to be:

@illusaen, which option do you think we should go with? Or are there other options or considerations we should discuss.

@guarani guarani reopened this Oct 25, 2021
@SiobhyB
Copy link
Contributor

SiobhyB commented Oct 26, 2021

To make sure I understand correctly: would the custom URL option make every image in the gallery link to the same place?

If yes, I'm not certain whether this option would be that widely used with the Tiled Gallery block. I could see users wanting to edit individual images in a gallery with a custom URL, but am having a harder time imagining the need for all images in a gallery to link to the same page/post.

With that understanding, I'd vote to match the web's implementation of "Link To", as I think the option to link the gallery's images to their attachment pages or media files would be something a lot of users look for. If there are blockers to that, I personally think we should maybe consider shipping without the "Link To" option for now, rather than shipping with only the custom URL option.

Interested to hear other thoughts!

@kyleaparker
Copy link

@guarani out of the options you presented, I think it makes sense to go with either:

Ship the Tiled Gallery without Link To support and revisit in the future

or

b) matching the web's options + custom URL support (the UI might be available once Add Media File and Attachment Page options to the native Image block Link To menu WordPress/gutenberg#34846 is merged)

It may be best to start without link support, and then work on shipping WordPress/gutenberg#34846 so that it doesn't delay the release of the block.

@guarani
Copy link
Contributor

guarani commented Oct 26, 2021

To make sure I understand correctly: would the custom URL option make every image in the gallery link to the same place?

Yes, I understood the offline conversation mentioned in #4136 (comment) (internal link p1634839508035800-slack-C6UJ0KRKQ) to mean every image in the gallery has the same link, but I might have misunderstood. I do agree with you here @SiobhyB that setting a custom link for all images might be of limited use to the user.

FWIW, if the offline conversation instead meant the ability to set a different custom link on each image, my current understanding is that there would still have incompatibility issues with the web where there is no custom link option and "Link to" settings do not apply to individual images but to the entire Tiled Gallery.


@SiobhyB @kyleaparker, @illusaen it sounds like the first potentially shippable Tiled Gallery block would be without "Link to" functionality. A later iteration would add the web's link to options ("Media File" and "Attachment Page") at a gallery-level, matching the web. A later iteration might include custom link support, but at that stage we would have to consider whether the web's Tiled Gallery can be updated as well for compatibility reasons.
Does this sound right? As a next step, I could update #4156 to capture the need for implementing the web's options, but add it to a later phase of the project (to allow WordPress/gutenberg#34846 to be merged first and avoid duplicating efforts on the UI).

@SiobhyB
Copy link
Contributor

SiobhyB commented Oct 28, 2021

Thanks for clarifying Paul, and what you've outlined for the next steps seems good to me!

@kyleaparker
Copy link

@guarani yes that sounds right to me!

@guarani
Copy link
Contributor

guarani commented Oct 29, 2021

I've updated #4156 with the Link To requirements we've decided on above and am closing this issue. Please feel free to re-open if needed.

@guarani guarani closed this as completed Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tiled Gallery block Issues with this label will automatically appear on the project's board [Type] Discussion
Projects
None yet
Development

No branches or pull requests

4 participants