section data-section-id=“{{ section.id }}” data-section-type=“list-collections”> - {{ ‘general.breadcrumb.home’ | t }} {%- render ‘icon’, icon: ‘arrow-right’ -%}
- {{ page.title }}
{%- assign menu_handle = page.content | default: page.title | strip_html | handle -%} {%- assign menu = linklists[menu_handle] -%} {%- assign has_brand_collections = false -%} {%- assign has_normal_collections = false -%} {%- for link in menu.links -%} {%- unless link.type == ‘collection_link’ -%} {%- continue -%} {%- endunless -%} {%- if link.object.template_suffix contains ‘brand’ -%} {%- assign has_brand_collections = true -%} {%- else -%} {%- assign has_normal_collections = true -%} {%- endif -%} {%- endfor -%} {%- if has_normal_collections -%} {{ page.title }}
{%- for link in menu.links -%} {%- unless link.type == ‘collection_link’ -%} {%- continue -%} {%- endunless -%} {%- unless link.object.template_suffix contains ‘brand’ -%} {%- endunless -%} {%- endfor -%} {%- endif -%} {%- if has_brand_collections -%} {{ ‘collection.general.brands’ | t }}
{%- for link in menu.links -%} {%- unless link.type == ‘collection_link’ -%} {%- continue -%} {%- endunless -%} {%- if link.object.template_suffix contains ‘brand’ -%} {%- assign max_height_mobile = 50 -%} {%- assign max_height_desktop = 90 -%} {%- assign max_width_mobile = 100 | divided_by: link.object.image.aspect_ratio | at_most: 100 -%} {%- assign max_width_desktop = 140 | divided_by: link.object.image.aspect_ratio | at_most: 140 -%} {%- if link.object.image.aspect_ratio < 1.5 -%} {%- if link.object.image.height < max_height_desktop -%} {%- assign max_width_desktop = link.object.image.width | times: link.object.image.aspect_ratio | round -%} {%- else -%} {%- assign max_width_desktop = max_height_desktop | times: link.object.image.aspect_ratio | round -%} {%- endif -%} {%- if link.object.image.height < max_height_mobile -%} {%- assign max_width_mobile = link.object.image.width | times: link.object.image.aspect_ratio | round -%} {%- else -%} {%- assign max_width_mobile = max_height_mobile | times: link.object.image.aspect_ratio | round -%} {%- endif -%} {%- elsif link.object.image.aspect_ratio > 2.5 -%} {%- assign max_width_mobile = 100 -%} {%- assign max_width_desktop = 140 -%} {%- endif -%}
#block-{{ forloop.index0 }} .quick-links__image-ie-fix { max-width: {{ max_width_mobile }}px; } @media screen and (min-width: 641px) { #block-{{ forloop.index0 }} .quick-links__image-ie-fix { max-width: {{ max_width_desktop }}px; } } {%- endif -%} {%- endfor -%} {%- endif -%} why this code is not working ?
- {{ ‘general.breadcrumb.home’ | t }} {%- render ‘icon’, icon: ‘arrow-right’ -%}
- {{ page.title }}
{{ page.title }}
{%- for link in menu.links -%} {%- unless link.type == ‘collection_link’ -%} {%- continue -%} {%- endunless -%} {%- unless link.object.template_suffix contains ‘brand’ -%} {%- endunless -%} {%- endfor -%}
{{ ‘collection.general.brands’ | t }}
{%- for link in menu.links -%} {%- unless link.type == ‘collection_link’ -%} {%- continue -%} {%- endunless -%} {%- if link.object.template_suffix contains ‘brand’ -%} {%- assign max_height_mobile = 50 -%} {%- assign max_height_desktop = 90 -%} {%- assign max_width_mobile = 100 | divided_by: link.object.image.aspect_ratio | at_most: 100 -%} {%- assign max_width_desktop = 140 | divided_by: link.object.image.aspect_ratio | at_most: 140 -%} {%- if link.object.image.aspect_ratio < 1.5 -%} {%- if link.object.image.height < max_height_desktop -%} {%- assign max_width_desktop = link.object.image.width | times: link.object.image.aspect_ratio | round -%} {%- else -%} {%- assign max_width_desktop = max_height_desktop | times: link.object.image.aspect_ratio | round -%} {%- endif -%} {%- if link.object.image.height < max_height_mobile -%} {%- assign max_width_mobile = link.object.image.width | times: link.object.image.aspect_ratio | round -%} {%- else -%} {%- assign max_width_mobile = max_height_mobile | times: link.object.image.aspect_ratio | round -%} {%- endif -%} {%- elsif link.object.image.aspect_ratio > 2.5 -%} {%- assign max_width_mobile = 100 -%} {%- assign max_width_desktop = 140 -%} {%- endif -%}
#block-{{ forloop.index0 }} .quick-links__image-ie-fix { max-width: {{ max_width_mobile }}px; } @media screen and (min-width: 641px) { #block-{{ forloop.index0 }} .quick-links__image-ie-fix { max-width: {{ max_width_desktop }}px; } } {%- endif -%} {%- endfor -%}