From 92374c0a1ed2143d94774d839ec309e17a9c15b0 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Sat, 29 Jun 2024 12:37:15 +0200 Subject: [PATCH] image with text link --- sections/image-with-text.liquid | 103 ++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/sections/image-with-text.liquid b/sections/image-with-text.liquid index 0a24e48..dafc16c 100644 --- a/sections/image-with-text.liquid +++ b/sections/image-with-text.liquid @@ -24,6 +24,24 @@ endif -%} +{% liquid + assign button_link = "" + + for block in section.blocks + case block.type + when 'button' + if block.settings.button_link != blank + assign button_link = block.settings.button_link + endif + endcase + endfor +%} + + + +
@@ -107,6 +125,91 @@
+{% comment %} +
+
+
+
+
+
+ {%- if section.settings.image != blank -%} + {%- if section.settings.image_behavior == 'ambient' or section.settings.image_behavior == 'zoom-in' -%} + {%- assign widths = '198, 432, 642, 900, 1284, 1800' -%} + {%- capture sizes -%} + (min-width: {{ settings.page_width }}px) {{ settings.page_width | minus: 100 | divided_by: 1.6667 }}px, + (min-width: 750px) calc((100vw - 130px) / 1.667), calc((100vw - 50px) / 1.667) + {%- endcapture -%} + {%- else -%} + {%- assign widths = '165, 360, 535, 750, 1070, 1500' -%} + {%- capture sizes -%} + (min-width: {{ settings.page_width }}px) {{ settings.page_width | minus: 100 | divided_by: 2 }}px, + (min-width: 750px) calc((100vw - 130px) / 2), calc((100vw - 50px) / 2) + {%- endcapture -%} + {%- endif -%} + {{ + section.settings.image + | image_url: width: 1500 + | image_tag: sizes: sizes, widths: widths, fetchpriority: fetch_priority + }} + {%- else -%} + {{ 'detailed-apparel-1' | placeholder_svg_tag: 'placeholder-svg' }} + {%- endif -%} +
+
+
+
+ {%- for block in section.blocks -%} + {% case block.type %} + {%- when 'heading' -%} +

+ {{ block.settings.heading }} +

+ {%- when 'caption' -%} +

+ {{ block.settings.caption | escape }} +

+ {%- when 'text' -%} +
+ {{ block.settings.text }} +
+ {%- when 'button' -%} + {%- if block.settings.button_label != blank -%} + + {{ block.settings.button_label | escape }} + + {%- endif -%} + {%- endcase -%} + {%- endfor -%} +
+
+
+
+
+
+{% endcomment %} + {% schema %} { "name": "t:sections.image-with-text.name",