In my honest opinion this should have been an out of the box feature. Along with clickable columns in the multi-column layout.
But I have restructured the schema and added some conditional statements that will make it much easier to make an image banner clickable.
Show More
{%- if section.settings.image != blank -%}
{%- if section.settings.image_banner_link_1 != blank -%} {%- endif -%} {%- if section.settings.image_banner_link_1 != blank -%} {%- endif -%}
{%- elsif section.settings.image_2 == blank -%}{{ 'lifestyle-2' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%} {%- if section.settings.image_2 != blank -%}{%- if section.settings.image_banner_link_2 != blank -%} {%- endif -%} {%- if section.settings.image_banner_link_2 != blank -%} {%- endif -%}
{%- endif -%} {%- if section.settings.image_banner_link_1 == blank and section.settings.image_banner_link_2 == blank -%}
{%- for block in section.blocks -%} {%- case block.type -%} {%- when 'heading' -%}## {{ block.settings.heading | escape }}{%- when 'text' -%}{{ block.settings.text | escape }}
{%- when 'buttons' -%}{%- if block.settings.button_label_1 != blank -%}
{%- endcase -%} {%- endfor -%}
{%- endif -%}
{% schema %} { "name": "t:sections.image-banner.name", "tag": "section", "class": "spaced-section spaced-section--full-width", "settings": [ { "type": "image_picker", "id": "image", "label": "t:sections.image-banner.settings.image.label" }, { "type": "url", "id": "image_banner_link_1", "label": "Image Link 1", "info": "To use button and header blocks, remove links 1 and 2." }, { "type": "image_picker", "id": "image_2", "label": "t:sections.image-banner.settings.image_2.label" }, { "type": "url", "id": "image_banner_link_2", "label": "Image Link 2", "info": "To use button and header blocks, remove links 1 and 2." }, { "type": "checkbox", "id": "adapt_height_first_image", "default": false, "label": "t:sections.image-banner.settings.adapt_height_first_image.label" }, { "type": "select", "id": "desktop_text_box_position", "options": [ { "value": "flex-start", "label": "t:sections.image-banner.settings.desktop_text_box_position.options__1.label" }, { "value": "center", "label": "t:sections.image-banner.settings.desktop_text_box_position.options__2.label" }, { "value": "flex-end", "label": "t:sections.image-banner.settings.desktop_text_box_position.options__3.label" } ], "default": "center", "label": "t:sections.image-banner.settings.desktop_text_box_position.label" }, { "type": "checkbox", "id": "show_text_box", "default": true, "label": "t:sections.image-banner.settings.show_text_box.label" }, { "type": "range", "id": "image_overlay_opacity", "min": 0, "max": 100, "step": 10, "unit": "%", "label": "t:sections.image-banner.settings.image_overlay_opacity.label", "default": 0 }, { "type": "select", "id": "color_scheme", "options": [ { "value": "accent-1", "label": "t:sections.image-banner.settings.color_scheme.options__1.label" }, { "value": "accent-2", "label": "t:sections.image-banner.settings.color_scheme.options__2.label" }, { "value": "background-1", "label": "t:sections.image-banner.settings.color_scheme.options__3.label" }, { "value": "background-2", "label": "t:sections.image-banner.settings.color_scheme.options__4.label" }, { "value": "inverse", "label": "t:sections.image-banner.settings.color_scheme.options__5.label" } ], "default": "background-1", "label": "t:sections.image-banner.settings.color_scheme.label", "info": "t:sections.image-banner.settings.color_scheme.info" }, { "type": "header", "content": "t:sections.image-banner.settings.header.content" }, { "type": "checkbox", "id": "stack_images_on_mobile", "default": true, "label": "t:sections.image-banner.settings.stack_images_on_mobile.label" }, { "type": "checkbox", "id": "show_text_below", "default": true, "label": "t:sections.image-banner.settings.show_text_below.label" } ], "blocks": [ { "type": "heading", "name": "t:sections.image-banner.blocks.heading.name", "limit": 1, "settings": [ { "type": "text", "id": "heading", "default": "Image banner", "label": "t:sections.image-banner.blocks.heading.settings.heading.label" }, { "type": "select", "id": "heading_size", "options": [ { "value": "medium", "label": "t:sections.image-banner.blocks.heading.settings.heading_size.options__1.label" }, { "value": "large", "label": "t:sections.image-banner.blocks.heading.settings.heading_size.options__2.label" } ], "default": "medium", "label": "t:sections.image-banner.blocks.heading.settings.heading_size.label" } ] }, { "type": "text", "name": "t:sections.image-banner.blocks.text.name", "limit": 1, "settings": [ { "type": "text", "id": "text", "default": "Give customers details about the banner image(s) or content on the template.", "label": "t:sections.image-banner.blocks.text.settings.text.label" } ] }, { "type": "buttons", "name": "t:sections.image-banner.blocks.buttons.name", "limit": 1, "settings": [ { "type": "text", "id": "button_label_1", "default": "Button label", "label": "t:sections.image-banner.blocks.buttons.settings.button_label_1.label", "info": "t:sections.image-banner.blocks.buttons.settings.button_label_1.info" }, { "type": "url", "id": "button_link_1", "label": "t:sections.image-banner.blocks.buttons.settings.button_link_1.label" }, { "type": "checkbox", "id": "button_style_secondary_1", "default": false, "label": "t:sections.image-banner.blocks.buttons.settings.button_style_secondary_1.label" }, { "type": "text", "id": "button_label_2", "default": "Button label", "label": "t:sections.image-banner.blocks.buttons.settings.button_label_2.label", "info": "t:sections.image-banner.blocks.buttons.settings.button_label_2.info" }, { "type": "url", "id": "button_link_2", "label": "t:sections.image-banner.blocks.buttons.settings.button_link_2.label" }, { "type": "checkbox", "id": "button_style_secondary_2", "default": false, "label": "t:sections.image-banner.blocks.buttons.settings.button_style_secondary_2.label" } ] } ], "presets": [ { "name": "t:sections.image-banner.presets.name", "blocks": [ { "type": "heading" }, { "type": "text" }, { "type": "buttons" } ] } ] } {% endschema %} ```