Code placement: Multiple users are unclear about exactly where to insert the code within the collage.liquid file (which contains 400+ lines)
Scope of changes: Questions about whether to replace all existing code or only modify specific sections
Variable identification: Uncertainty about which Liquid variables reference the main collage image
Targeting specific images: Some users want only the main image clickable, not all images in the collage
Current Status:
The discussion remains open with ongoing requests for more detailed, beginner-friendly instructions. Users are sharing screenshots and code snippets seeking clarification on implementation steps. No definitive, step-by-step solution has been confirmed as working for all participants.
Summarized with AI on November 9.
AI used: claude-sonnet-4-5-20250929.
Im new to shopify, and I am in need of the code for making a collage clickable. If anyone could just paste it below, I would be extremely grateful. The idea is that, when the client clicks on the image, it will bring them to the product page for that specific product being displayed.
We are AliReviews - All-in-one reviews solution for all businesses.
To make a collage clickable and link it to the product page, you can use the following code:
You can customize the code to fit the specific layout and number of images in your collage. Just make sure to wrap each image in an anchor tag and link it to the product URL using {{ product.url }}.
Hope this can help, don’t be hesitate to contact us if you have any further questions, we’d love to assist. Please hit the Like Button or mark it as Accepted Solution to let us know, it encourage us a lot.
Thanks so much. But where do I put this code? Below is the collage as it stands. So I have not added any images yet, however, I will be adding images of products in our store. I assume I need to edit the “collage.liquid”. If it isn’t too much of a hassle, I would really appreciate it if you could implement the above code into the collage.liquid and paste the entire collage.liquid. Otherwise, then all good and I really appreciate your help!
Hi There! I would also like to make my main collage image clickable. I just wanted to confirm that I am to replace all the code in the collage.liquid file with code provided above? The default section is 400+ lines of code, so I just wanted to be sure. Also, where do I apply the link in this case? Thanks in advance.
No, you shouldn’t replace all of the code in the collage.liquid file.
You will need to locate the HTML code for your main collage image within the “collage.liquid” file and modify it to include the “a” tags, like this in the example
Make sure to replace “{{ main_collage_image }}” with the appropriate URL or liquid variable that references the main collage image.
Thank you @irene-vintage ! I believe I have found the HTML, and the variable used for the "main_collage_image " is “media media–transparent ratio” based on the inspect tool, I have paste the code here, would you mind informing me on how to apply? I have little to no experience coding other than copy and pasting snippets and mild css edits.
I wonder if you can help. We have a lookbook page which is all collages. We want to make the images of products clickable on this page. Do you know what code and exactly where should we paste it into the collage.liquid? Many thanks!
Hi, I am trying to follow your instructions but finding it a little unclear. I am trying to add a link to ONLY the main picture in the collage, so do I only copy the first 4 lines of your code?
Could you please be a little more specific as to where this code needs to be copied into the file ( for us beginners that have very limited clue :), I have included a screenshot of the code if you could kindly point it out