-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
External links in the Gallery block (was #5366) #10057
Comments
Hi! Thanks for raising this issue here. It has been a request for some time and, because of the way the underlying infrastructure for media is set up, there is not an easy way to a solution yet. Continuing to raise the issue and hearing from people who want this feature and who can take a moment to say a few details about their use case and why it is important to them would be good to collect going forward. Here are a few example past requests from both WordPress.org and WordPress.com ideas forums:
I have also added this issue to the |
Thankyou.
It seems to me that images should be handled consistently across websites.
That if a website has images, whether single or in a gallery grid they
should be clickable to go to a meaningful link.
Thankyou for passing this one.
MIchael
…On Fri, 21 Sep 2018 at 04:25, Sheri Bigelow ***@***.***> wrote:
Hi! Thanks for raising this issue here. It has been a request for some
time and, because of the way the underlying infrastructure for media is set
up, there is not an easy way to a solution yet. Continuing to raise the
issue and hearing from people who want this feature and who can take a
moment to say a few details about their use case and why it is important to
them would be good to collect going forward.
Here are a few example past requests from both WordPress.org and
WordPress.com ideas forums:
-
https://wordpress.org/ideas/topic/custom-links-on-images-within-a-gallery
-
https://en.forums.wordpress.com/topic/link-gallery-images-to-pages-and-or-posts-or-external-url/
I have also added this issue to the Ideas project where it will be
reviewed in the next phase of development after the editor is merged into
the core WordPress project.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10057 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ApbA_c7nSvlzqAUrLPzpXX8Z5fjYl0Q2ks5uc_nEgaJpZM4Wxi5T>
.
--
Websites
Boat Plans - storerboatplans.com <http://storerboatplans.com/wp>
Sailmaking - Really Simple Sails <http://reallysimplesails.com>
Goose Sailboat <http://opengoose.com>
Facebook Groups
Really Simple Sails <https://web.facebook.com/groups/1741841469384966/>
Storer Boat Plans <https://web.facebook.com/groups/storerboatplans/>
Goat Island Skiff
<https://web.facebook.com/groups/GoatIslandSkiff/?ref=bookmarks>
Oz Goose sailboat <https://web.facebook.com/groups/opengoose/>
|
+1 on this request. It's been "asked" for as long as 8 years. Now with Guttenberg released could you add the simple "custom url" option for images in what you now call "gallery"... Thanks! :) ps: the reason is that the alignment of normal block images is always wrong if you're trying to have 2 next to each other. So I use gallery - but then can't link... |
I would very much like this as well. I have no idea why WordPress let's you link a single image to a custom URL, but not multiple images. I think any website that highlights themes, products, services, etc. is going to want to show images of those things with links to the individual pages that have more details about them. This is so common across websites I think it should be a core feature. We'll need this not just for Galleries, but for Media & Text blocks as well. In fact, any block with an image should allow that image to be linked to a custom URL. Here is a direct use-case from my home page. Each theme screenshot links to the detailed information page for that theme. Of course I had to build this manually with HTML and CSS. It certainly would be great to replicate this in GB without any code simply by using a Text & Media block followed by a Gallery Block. |
This feature would be very useful to me. Often a collection of images acts as a list of links. +1 for this feature. |
I'm also working on a website, and I have a gallery that I need to link to several internal pages, and I'm having to look for a plugin to fix that. |
+1 for this, it is baffling that the image block has this functionality but the gallery does not. It's already possible to select each individual gallery image in a gallery and link it either to its attachment page or media page, so why not the custom URL option there too? |
I also think this is a must have feature. For those that need it within the next 8 years before WordPress finally adds it, here is a workaround - when adding a caption in the gutenberg editor (double click on a gallery image), you can add a link in the element. You can then use css to make the link align with the gallery image and simulate the needed behavior. |
+1 |
As far as I can tell, the "Link To" field applies to the block as a whole, not to the selected image. As such, it's not quite as simple to add a "Custom URL" option, at least not without supporting just one URL for all images, rather than a distinct URL for each image. I think the attribute structure of the block seems like it could (or even currently does?) support individual image links, but there may be some design / UX work necessary to distinguish the block controls from the individual image. |
Ahh you're right, it is global for the whole block, while you can individually select each image and add a caption to it etc. So a bit more work than a copy-paste of a dropdown item so to speak, but yet another reason we should indeed clear up the UX of these settings. |
Adding a +1 on this. Every one of my sites request this behavior (most common application is a groups of logos that link out). I have been getting by with the Gallery Custom Links plugin, but there seems to be an incompatibility with the rest API that the plugin owner is not sure how to fix and causes some random issues with the Gutenberg editor. With the image block that has a link option my clients are totally confused as to why you can apply a link to an individual image but not one in a gallery... Seems like it's time to prioritize this one? |
+1 |
I already commented on an similiar/duplicate issue: #14797 Why the Custom URL setting is useful for the Gallery BlockI really need this setting for the Gallery. I find it very useful to have a Custom URL setting in the GalleryImage component like we already have for the Image Block, so every GalleryImage in the Gallery can have its own custom link URL (individually). There are other solutions where the link url and link target is saved directly in the image in the Media Library. This solution leads to problems. When the same image is used in different galleries, the link can not be set individually. I can't let my customers use the core Gallery Block, because it lacks this feature compared to the core Image Block. The Core Image Block already has a good implementationThe Core Gallery Block & GalleryImage don't have the needed optionWhy are the Image and GalleryImage settings so inconsistent? ( #11436 is also a bit related ) |
Suggestion for the Gallery UI/UXAdd an option named "Custom URLs" to the "Link To" field in the controls sidebar. If this setting selected and you click on a single GalleryImage / select a single image in the Gallery, a This way, it would be easily possible to activate custom URLs in the sidebar and set individual URLs to each image in the Gallery. |
Would find that useful, too. |
+1 |
1 similar comment
+1 |
I believe the plan for the Gallery block is to enable the Gallery to use nested Image blocks. When this happens, each Image block would include its features like adding a URL to the individual image which would resolve this issue. @youknowriad, is this something we can begin development on? |
A js alternative to make gallery images clickable:
Note: if you don't want the caption, just replace |
Implementation of this right now, as @aduth mentioned above, is not easy as the link URLs would need to be stored inline in the gallery's HTML. The current Link To setting is stored once for the entire block. As @mapk says, there has been frequent talk among the editor team that the gallery block ought to be rewritten to use inner blocks. This would allow this issue to be addressed, but is a significant undertaking. I'm removing the |
I echo the OP's usage. Using a gallery is the best way to organize a frequently-changing list of logos/manufacturers/etc... I understand this might take significant work, but it seems very much with it as the current system seems inconsistent with how the rest of the Wordpress image insertion works. This would be a classic "doesn't work as expected" scenario. |
This is where I landed:
Started from @nirodaonline 's code - thank you. |
Hello! I am looking into this and haven´t found a solution. The Gallery plugin doesn´t work, perhaps for the new WordPress version, I don´t know. I am new to WordPress. How do I use your function? |
Another way to go around this, (which isn't how it's supposed to work, obviously), is use the caption, set up a link, and span that link over the whole gallery item through CSS and a |
Thanks for your quick reply! I don´t know how to do that, how to write that piece of CSS code. Can you help me or send me a link to see how to do it? |
This wasn't a direct response to your reply, to have your JS snippet working, you have to put the piece of javascript/jquery code in your website, this can be done through multiple ways, I recommend following a tutorial like this , good luck ! |
As addition to @nirodaonline and @jivygraphics jQuery approach and to help people like @butifarra, here is a temporary workaround in CSS that hijacks the image caption feature (thanks to @poespas for the initial idea)
Bonus: If you still need the image caption feature, add the css class ".has-caption" to the gallery in gutenberg. This will re-enable the shadow background and display the white caption text at the bottom of the image again.
|
A Gallery block containing nested Image blocks is being built in this PR: #25940 |
Hi! I just wanted to post that this CSS worked for me perfectly without messing up the styling.
|
+1 here I've found that it's already possible by modifying the gallery's HTML code, but Wordpress then tells me that block has invalid content. However, it still works, even with this error. |
2 years later we still got this problem huh.
…On Fri, May 28, 2021 at 4:55 AM Benoit Tachet ***@***.***> wrote:
+1 here
I've found that it's olready possible by modifying the gallery's HTML
code, but Wordpress then tells me that block has invalid content. However,
it still works, even with this error.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#10057 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF2T4CHQGQHZVFQQECDW23TP5LBZANCNFSM4FWGFZJQ>
.
|
Hello everyone. There is a refactored Gallery block containing inner Image blocks. The refactored Gallery block will soon be added to the Gutenberg plugin. There will be a parent "container" with the Gallery settings. |
As @paaljoachim notes, the refactor of the gallery block is a better long term fix to this problem than adding a custom link option to the existing gallery, as it makes use of the existing functionality within the Image block, rather than having to duplicate this into the gallery block. 🤞 we won't be too far away from getting this merged into the plugin. |
Howdy,
I've been digging around trying to find a solution to this.
Many of us want a gallery to do work on our website rather than just be a pretty feature.
Many of the Block based WP editors have this capability for their gallery blocks. So they must have assessed that there was a demand for it.
To do it would be great to have links - for me to link to more intensive information about the object in the image. Is the web to be visual or not. I use text links too. But the gallery allows a direct emotional link for the reader and immediate satisfaction.
The original thread on this was closed because someone on the team considered that there was no interest in developing this aspect.
After digging around to find a solution I see lots of questions on it around the web in various forae.
Thanks for your consideration and work.
Michael Storer.
The text was updated successfully, but these errors were encountered: