How can I make collage images clickable on my homepage?

Topic summary

Goal: Make homepage collage images clickable in a Shopify store (Studio theme).

Key actions and proposal:

  • Helpers asked for the store address and the collage.liquid file. The OP pasted partial code (collage section with image/media markup and schema fragments).
  • A contributor provided a full replacement for collage.liquid, including a new image block setting: type: url, id: link (to attach a hyperlink per image). They instructed replacing the entire section code. The posted code appears truncated in the thread, but the intent is to enable per-image links via the new Link field.

Related, separate questions (unresolved in-thread):

  • OP asked about hiding the quantity selector for single-quantity vintage items while showing it for products with multiples. They were asked to open a new community question.
  • Another user asked if Debut theme’s Header “Custom CSS” field can add hyperlinks (and its purpose). No answer provided.
  • Another user asked if the provided code works on the Trade theme and shared a preview link. No answer provided.

Status: No confirmation that the code fix worked; multiple follow-up questions remain open. Code snippets are central to this thread.

Summarized with AI on December 29. AI used: gpt-5.

Hi!

I’m trying to make the collage images on the homepage clickable (aka attach link) Im using the “studio” template. Can anyone help me out? Not very good at coding! Thanks!

Please tell us your store address

Please share your collage.liquid file.

After modifying the code for you, you can override it

Hi @duonyc ,

Please send me the code of collage.liquid file, I will check and add it for you.

Thank you! should I just copy and paste it here or send a pic?

{{ ‘collage.css’ | asset_url | stylesheet_tag }}
{{ ‘component-card.css’ | asset_url | stylesheet_tag }}
{{ ‘component-price.css’ | asset_url | stylesheet_tag }}
{{ ‘component-modal-video.css’ | asset_url | stylesheet_tag }}

{%- style -%}
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
}

@media screen and (min-width: 750px) {
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
}
{%- endstyle -%}

{{ section.settings.heading | escape }}

{%- for block in section.blocks -%}
{%- case block.type -%} {%- when 'image' -%}
{%- if block.settings.image != blank -%} {{ block.settings.image.alt | escape }} {%- else -%} {{ 'image' | placeholder_svg_tag: 'placeholder-svg placeholder' }} {%- endif -%}
{%- when 'product' -%} {% render 'card-product', card_product: block.settings.product, media_aspect_ratio: 'adapt', show_secondary_image: block.settings.second_image, extend_height: true %} {%- when 'collection' -%} {% render 'card-collection', card_collection: block.settings.collection, media_aspect_ratio: 'adapt', columns: 2, extend_height: true %} {%- when 'video' -%}
{%- if block.settings.cover_image != blank -%} {{ block.settings.description | escape }} {%- else -%} {{ 'collection-2' | placeholder_svg_tag: 'placeholder-svg placeholder' }} {%- endif -%}
{%- render 'icon-play' -%}

{%- if block.settings.cover_image != blank -%}
<img
srcset=“{%- if block.settings.cover_image.width >= 550 -%}{{ block.settings.cover_image | image_url: width: 550 }} 550w,{%- endif -%}
{%- if block.settings.cover_image.width >= 720 -%}{{ block.settings.cover_image | image_url: width: 720 }} 720w,{%- endif -%}
{%- if block.settings.cover_image.width >= 990 -%}{{ block.settings.cover_image | image_url: width: 990 }} 990w,{%- endif -%}
{%- if block.settings.cover_image.width >= 1100 -%}{{ block.settings.cover_image | image_url: width: 1100 }} 1100w,{%- endif -%}
{%- if block.settings.cover_image.width >= 1500 -%}{{ block.settings.cover_image | image_url: width: 1500 }} 1500w,{%- endif -%}
{%- if block.settings.cover_image.width >= 2200 -%}{{ block.settings.cover_image | image_url: width: 2200 }} 2200w,{%- endif -%}
{%- if block.settings.cover_image.width >= 3000 -%}{{ block.settings.cover_image | image_url: width: 3000 }} 3000w,{%- endif -%}
{{ block.settings.cover_image | image_url }} {{ block.settings.cover_image.width }}w”
src=“{{ block.settings.cover_image | image_url: width: 1500 }}”
sizes=“(min-width: {{ settings.page_width }}px) {% if section.blocks.size == 1 %}calc({{ settings.page_width }}px - 100px){% else %}{{ settings.page_width | minus: 100 | times: 0.67 | round }}px{% endif %}, (min-width: 750px){% if section.blocks.size == 1 %} calc(100vw - 100px){% else %} 500px{% endif %}, calc(100vw - 30px)”
alt=“{{ block.settings.description | escape }}”
loading=“lazy”
width=“{{ block.settings.cover_image.width }}”
height=“{{ block.settings.cover_image.height }}”

{%- else -%}
{{ ‘collection-2’ | placeholder_svg_tag: ‘placeholder-svg placeholder’ }}
{%- endif -%}

{% render 'icon-close' %}
{%- if block.settings.video_url.type == 'youtube' -%} {%- else -%} {%- endif -%}
{%- endcase -%}
{%- endfor -%}

{% schema %}
{
“name”: “t:sections.collage.name”,
“tag”: “section”,
“class”: “section”,
“settings”: [
{
“type”: “text”,
“id”: “heading”,
“default”: “Multimedia collage”,
“label”: “t:sections.collage.settings.heading.label”
},
{
“type”: “select”,
“id”: “heading_size”,
“options”: [
{
“value”: “h2”,
“label”: “t:sections.all.heading_size.options__1.label”
},
{
“value”: “h1”,
“label”: “t:sections.all.heading_size.options__2.label”
},
{
“value”: “h0”,
“label”: “t:sections.all.heading_size.options__3.label”
}
],
“default”: “h1”,
“label”: “t:sections.all.heading_size.label”
},
{
“type”: “select”,
“id”: “desktop_layout”,
“options”: [
{
“value”: “left”,
“label”: “t:sections.collage.settings.desktop_layout.options__1.label”
},
{
“value”: “right”,
“label”: “t:sections.collage.settings.desktop_layout.options__2.label”
}
],
“default”: “left”,
“label”: “t:sections.collage.settings.desktop_layout.label”
},
{
“type”: “select”,
“id”: “mobile_layout”,
“options”: [
{
“value”: “collage”,
“label”: “t:sections.collage.settings.mobile_layout.options__1.label”
},
{
“value”: “column”,
“label”: “t:sections.collage.settings.mobile_layout.options__2.label”
}
],
“default”: “collage”,
“label”: “t:sections.collage.settings.mobile_layout.label”
},
{
“type”: “select”,
“id”: “color_scheme”,
“options”: [
{
“value”: “accent-1”,
“label”: “t:sections.all.colors.accent_1.label”
},
{
“value”: “accent-2”,
“label”: “t:sections.all.colors.accent_2.label”
},
{
“value”: “background-1”,
“label”: “t:sections.all.colors.background_1.label”
},
{
“value”: “background-2”,
“label”: “t:sections.all.colors.background_2.label”
},
{
“value”: “inverse”,
“label”: “t:sections.all.colors.inverse.label”
}
],
“default”: “background-1”,
“label”: “t:sections.all.colors.label”,
“info”: “t:sections.all.colors.has_cards_info”
},
{
“type”: “header”,
“content”: “t:sections.all.padding.section_padding_heading”
},
{
“type”: “range”,
“id”: “padding_top”,
“min”: 0,
“max”: 100,
“step”: 4,
“unit”: “px”,
“label”: “t:sections.all.padding.padding_top”,
“default”: 36
},
{
“type”: “range”,
“id”: “padding_bottom”,
“min”: 0,
“max”: 100,
“step”: 4,
“unit”: “px”,
“label”: “t:sections.all.padding.padding_bottom”,
“default”: 36
}
],
“blocks”: [
{
“type”: “image”,
“name”: “t:sections.collage.blocks.image.name”,
“settings”: [
{
“type”: “image_picker”,
“id”: “image”,
“label”: “t:sections.collage.blocks.image.settings.image.label”
},
{
“type”: “checkbox”,
“id”: “image_padding”,
“default”: false,
“label”: “t:sections.collage.blocks.image.settings.image_padding.label”,
“info”: “t:sections.collage.blocks.image.settings.image_padding.info”
}
]
},
{
“type”: “product”,
“name”: “t:sections.collage.blocks.product.name”,
“settings”: [
{
“type”: “product”,
“id”: “product”,
“label”: “t:sections.collage.blocks.product.settings.product.label”
},
{
“type”: “checkbox”,
“id”: “second_image”,
“default”: false,
“label”: “t:sections.collage.blocks.product.settings.second_image.label”
}
]
},
{
“type”: “collection”,
“name”: “t:sections.collage.blocks.collection.name”,
“settings”: [
{
“type”: “collection”,
“id”: “collection”,
“label”: “t:sections.collage.blocks.collection.settings.collection.label”
}
]
},
{
“type”: “video”,
“name”: “t:sections.collage.blocks.video.name”,
“settings”: [
{
“type”: “image_picker”,
“id”: “cover_image”,
“label”: “t:sections.collage.blocks.video.settings.cover_image.label”
},
{
“type”: “video_url”,
“id”: “video_url”,
“accept”: [
“youtube”,
“vimeo”
],
“default”: “https://www.youtube.com/watch?v=_9VUPq3SxOc”,
“label”: “t:sections.collage.blocks.video.settings.video_url.label”,
“placeholder”: “t:sections.collage.blocks.video.settings.video_url.placeholder”,
“info”: “t:sections.collage.blocks.video.settings.video_url.info”
},
{
“type”: “text”,
“id”: “description”,
“default”: “Describe the video”,
“label”: “t:sections.collage.blocks.video.settings.description.label”,
“info”: “t:sections.collage.blocks.video.settings.description.info”
},
{
“type”: “checkbox”,
“id”: “image_padding”,
“default”: false,
“label”: “t:sections.collage.blocks.video.settings.image_padding.label”,
“info”: “t:sections.collage.blocks.video.settings.image_padding.info”
}
]
}
],
“max_blocks”: 3,
“presets”: [
{
“name”: “t:sections.collage.presets.name”,
“blocks”: [
{
“type”: “video”
},
{
“type”: “product”
},
{
“type”: “collection”
}
]
}
]
}
{% endschema %}

Hi @duonyc ,

Please change all code:

{{ 'collage.css' | asset_url | stylesheet_tag }}
{{ 'component-card.css' | asset_url | stylesheet_tag }}
{{ 'component-price.css' | asset_url | stylesheet_tag }}
{{ 'component-modal-video.css' | asset_url | stylesheet_tag }}

{%- style -%}
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
}

@media screen and (min-width: 750px) {
.section-{{ section.id }}-padding {
padding-top: {{ section.settings.padding_top }}px;
padding-bottom: {{ section.settings.padding_bottom }}px;
}
}
{%- endstyle -%}

  

    ## {{ section.settings.heading | escape }}
    
      {%- for block in section.blocks -%}
      

        {%- case block.type -%}
        {%- when 'image' -%}
        

          
            

              {%- if block.settings.image != blank -%}
              
              {%- else -%}
              {{ 'image' | placeholder_svg_tag: 'placeholder-svg placeholder' }}
              {%- endif -%}
            

          
        

        {%- when 'product' -%}
        {% render 'card-product',
card_product: block.settings.product,
        media_aspect_ratio: 'adapt',
        show_secondary_image: block.settings.second_image,
        extend_height: true
        %}
        {%- when 'collection' -%}
        {% render 'card-collection',
card_collection: block.settings.collection,
        media_aspect_ratio: 'adapt',
        columns: 2,
        extend_height: true
        %}
        {%- when 'video' -%}
        
          
          
          
        

        {%- endcase -%}
      

      {%- endfor -%}
    

  

{% schema %}
{
"name": "t:sections.collage.name",
"tag": "section",
"class": "section",
"settings": [
{
"type": "text",
"id": "heading",
"default": "Multimedia collage",
"label": "t:sections.collage.settings.heading.label"
},
{
"type": "select",
"id": "heading_size",
"options": [
{
"value": "h2",
"label": "t:sections.all.heading_size.options__1.label"
},
{
"value": "h1",
"label": "t:sections.all.heading_size.options__2.label"
},
{
"value": "h0",
"label": "t:sections.all.heading_size.options__3.label"
}
],
"default": "h1",
"label": "t:sections.all.heading_size.label"
},
{
"type": "select",
"id": "desktop_layout",
"options": [
{
"value": "left",
"label": "t:sections.collage.settings.desktop_layout.options__1.label"
},
{
"value": "right",
"label": "t:sections.collage.settings.desktop_layout.options__2.label"
}
],
"default": "left",
"label": "t:sections.collage.settings.desktop_layout.label"
},
{
"type": "select",
"id": "mobile_layout",
"options": [
{
"value": "collage",
"label": "t:sections.collage.settings.mobile_layout.options__1.label"
},
{
"value": "column",
"label": "t:sections.collage.settings.mobile_layout.options__2.label"
}
],
"default": "collage",
"label": "t:sections.collage.settings.mobile_layout.label"
},
{
"type": "select",
"id": "color_scheme",
"options": [
{
"value": "accent-1",
"label": "t:sections.all.colors.accent_1.label"
},
{
"value": "accent-2",
"label": "t:sections.all.colors.accent_2.label"
},
{
"value": "background-1",
"label": "t:sections.all.colors.background_1.label"
},
{
"value": "background-2",
"label": "t:sections.all.colors.background_2.label"
},
{
"value": "inverse",
"label": "t:sections.all.colors.inverse.label"
}
],
"default": "background-1",
"label": "t:sections.all.colors.label",
"info": "t:sections.all.colors.has_cards_info"
},
{
"type": "header",
"content": "t:sections.all.padding.section_padding_heading"
},
{
"type": "range",
"id": "padding_top",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "t:sections.all.padding.padding_top",
"default": 36
},
{
"type": "range",
"id": "padding_bottom",
"min": 0,
"max": 100,
"step": 4,
"unit": "px",
"label": "t:sections.all.padding.padding_bottom",
"default": 36
}
],
"blocks": [
{
"type": "image",
"name": "t:sections.collage.blocks.image.name",
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "t:sections.collage.blocks.image.settings.image.label"
},
{
"type": "url",
"id": "link",
"label": "Link"
},
{
"type": "checkbox",
"id": "image_padding",
"default": false,
"label": "t:sections.collage.blocks.image.settings.image_padding.label",
"info": "t:sections.collage.blocks.image.settings.image_padding.info"
}
]
},
{
"type": "product",
"name": "t:sections.collage.blocks.product.name",
"settings": [
{
"type": "product",
"id": "product",
"label": "t:sections.collage.blocks.product.settings.product.label"
},
{
"type": "checkbox",
"id": "second_image",
"default": false,
"label": "t:sections.collage.blocks.product.settings.second_image.label"
}
]
},
{
"type": "collection",
"name": "t:sections.collage.blocks.collection.name",
"settings": [
{
"type": "collection",
"id": "collection",
"label": "t:sections.collage.blocks.collection.settings.collection.label"
}
]
},
{
"type": "video",
"name": "t:sections.collage.blocks.video.name",
"settings": [
{
"type": "image_picker",
"id": "cover_image",
"label": "t:sections.collage.blocks.video.settings.cover_image.label"
},
{
"type": "video_url",
"id": "video_url",
"accept": [
"youtube",
"vimeo"
],
"default": "https://www.youtube.com/watch?v=_9VUPq3SxOc",
"label": "t:sections.collage.blocks.video.settings.video_url.label",
"placeholder": "t:sections.collage.blocks.video.settings.video_url.placeholder",
"info": "t:sections.collage.blocks.video.settings.video_url.info"
},
{
"type": "text",
"id": "description",
"default": "Describe the video",
"label": "t:sections.collage.blocks.video.settings.description.label",
"info": "t:sections.collage.blocks.video.settings.description.info"
},
{
"type": "checkbox",
"id": "image_padding",
"default": false,
"label": "t:sections.collage.blocks.video.settings.image_padding.label",
"info": "t:sections.collage.blocks.video.settings.image_padding.info"
}
]
}
],
"max_blocks": 3,
"presets": [
{
"name": "t:sections.collage.presets.name",
"blocks": [
{
"type": "video"
},
{
"type": "product"
},
{
"type": "collection"
}
]
}
]
}
{% endschema %}

Thank you so much!!! Another question: I sell some vintage items so there’s obviously not multiples. is it possible to have no quantity selector on the single products and then have a selector on the ones with multiples?

Hi @duonyc ,

You can create a question on the community and send me the link. I will check it.
Because this will help build a better community.
Thank you.

I’m wondering if the new Custom CSS field in the Header field of the Debut theme offers a simple way to attach a hyperlink to the image without doing all the backend coding edits described in this feed? If not, what is the purpose of this new feature? I need the quickest and most efficient way to regularly update the hyperlink to these images as they evolve. Thank you!

Will this code work on the new shopify Trade theme?

I need to make collage images (3 sections) on the home page.

https://thesportsconceptstore.myshopify.com

password: runforestrun