Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use collection.featured_image instead of image #245

Merged
merged 17 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
eb0b923
use collection.featured_image instead of image
martinamarien Jul 21, 2021
afb8a8e
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
f2b06f7
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
5fd2fd2
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
9120ba2
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
661f47d
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
1208566
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
a140e3c
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
399203b
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
4f056de
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
1c9770f
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
c2d534c
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
bd81cb0
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
9686ea9
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
234c3bc
Update from Shopify for theme dawn/fix-collection-card-image
shopify[bot] Jul 21, 2021
edf739e
revert setting changes made by online store git
martinamarien Jul 26, 2021
3ce8d64
fix end of line
martinamarien Jul 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions sections/collage.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,20 @@
{%- if block.settings.collection != blank -%}
<a href="{{ block.settings.collection.url }}" class="card animate-arrow">
<div class="collage-content card-colored color-{{ block.settings.color_scheme }}{% if block.settings.image_padding %} collage-card-spacing{% endif %}">
{%- if block.settings.collection.image != blank -%}
{%- if block.settings.collection.featured_image != blank -%}
<div class="collage-card__image-wrapper media media--transparent media--hover-effect">
<img srcset="{%- if block.settings.collection.image.width >= 500 -%}{{ block.settings.collection.image | img_url: '500x' }} 500w,{%- endif -%}
{%- if block.settings.collection.image.width >= 730 -%}{{ block.settings.collection.image | img_url: '730x' }} 730w,{%- endif -%}
{%- if block.settings.collection.image.width >= 1440 -%}{{ block.settings.collection.image | img_url: '1440x' }} 1440w,{%- endif -%}
{%- if block.settings.collection.image.width >= 990 -%}{{ block.settings.collection.image | img_url: '990x' }} 990w,{%- endif -%}
{%- if block.settings.collection.image.width >= 2080 -%}{{ block.settings.collection.image | img_url: '2080x' }} 2080w{%- endif -%}"
src="{{ block.settings.collection.image | img_url: '533x' }}"
<img srcset="{%- if block.settings.collection.featured_image.width >= 500 -%}{{ block.settings.collection.featured_image | img_url: '500x' }} 500w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 730 -%}{{ block.settings.collection.featured_image | img_url: '730x' }} 730w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 1440 -%}{{ block.settings.collection.featured_image | img_url: '1440x' }} 1440w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 990 -%}{{ block.settings.collection.featured_image | img_url: '990x' }} 990w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 2080 -%}{{ block.settings.collection.featured_image | img_url: '2080x' }} 2080w{%- endif -%}"
src="{{ block.settings.collection.featured_image | img_url: '533x' }}"
sizes="(min-width: 990px){% if section.blocks.size == 1 %} 990px{% else %} 730px{% endif %}, (min-width: 750px){% if section.blocks.size == 1 %} calc(100vw - 100px){% else%} 500px{% endif %}, calc(100vw - 30px)"
alt="{{ block.settings.collection.image.alt | escape }}"
alt="{{ block.settings.collection.featured_image.alt | escape }}"
loading="lazy"
width="{{ block.settings.collection.image.width }}"
height="{{ block.settings.collection.image.height }}"
class="collage-card__image"
width="{{ block.settings.collection.featured_image.width }}"
height="{{ block.settings.collection.featured_image.height }}"
class="collage-card__image"
>
</div>

Expand Down Expand Up @@ -540,4 +540,4 @@
}
]
}
{% endschema %}
{% endschema %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% endschema %}
{% endschema %}

26 changes: 13 additions & 13 deletions sections/collection-list.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,27 @@
{%- for block in section.blocks -%}
<li class="collection-list__item grid__item{% if section.settings.swipe_on_mobile %} slider__slide{% endif %}" {{ block.shopify_attributes }}>
<a{% if block.settings.collection != blank and block.settings.collection.all_products_count > 0 %} href="{{ block.settings.collection.url }}"{% endif %}
class="card animate-arrow link{% if block.settings.collection.image != blank %} card--media{% else %}{% if section.settings.image_ratio != 'adapt' %} card--stretch{% endif %}{% endif %}{% unless section.settings.image_padding %} card--light-border{% endunless %}"
class="card animate-arrow link{% if block.settings.collection.featured_image != blank %} card--media{% else %}{% if section.settings.image_ratio != 'adapt' %} card--stretch{% endif %}{% endif %}{% unless section.settings.image_padding %} card--light-border{% endunless %}"
>
<div class="card--stretch card-colored color-{{ section.settings.color_scheme }}">
{%- if block.settings.collection.image != blank -%}
{%- if block.settings.collection.featured_image != blank -%}
<div{% if section.settings.image_padding %} class="card__media-spacer"{% endif %}>
{% if section.settings.image_padding %}<div class="overlay-card"></div>{% endif %}
<div class="media{% if section.blocks.size > 1 %} media--{{ section.settings.image_ratio }}{% endif %} media--hover-effect overflow-hidden"
{% if section.settings.image_ratio == 'adapt' and section.blocks.size > 1 %}style="padding-bottom: {{ 1 | divided_by: block.settings.collection.image.aspect_ratio | times: 100 }}%;"{% endif %}>
{% if section.settings.image_ratio == 'adapt' and section.blocks.size > 1 %}style="padding-bottom: {{ 1 | divided_by: block.settings.collection.featured_image.aspect_ratio | times: 100 }}%;"{% endif %}>

<img srcset="{%- if block.settings.collection.image.width >= 165 -%}{{ block.settings.collection.image | img_url: '165x' }} 165w,{%- endif -%}
{%- if block.settings.collection.image.width >= 330 -%}{{ block.settings.collection.image | img_url: '330x' }} 330w,{%- endif -%}
{%- if block.settings.collection.image.width >= 535 -%}{{ block.settings.collection.image | img_url: '535x' }} 535w,{%- endif -%}
{%- if block.settings.collection.image.width >= 720 -%}{{ block.settings.collection.image | img_url: '720x' }} 720w,{%- endif -%}
{%- if block.settings.collection.image.width >= 940 -%}{{ block.settings.collection.image | img_url: '940x' }} 940w,{%- endif -%}
{%- if block.settings.collection.image.width >= 1440 -%}{{ block.settings.collection.image | img_url: '1440x' }} 1440w,{%- endif -%}
{%- if block.settings.collection.image.width >= 1880 -%}{{ block.settings.collection.image | img_url: '1880x' }} 1880w{%- endif -%}"
src="{{ block.settings.collection.image | img_url: '533x' }}"
<img srcset="{%- if block.settings.collection.featured_image.width >= 165 -%}{{ block.settings.collection.featured_image | img_url: '165x' }} 165w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 330 -%}{{ block.settings.collection.featured_image | img_url: '330x' }} 330w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 535 -%}{{ block.settings.collection.featured_image | img_url: '535x' }} 535w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 720 -%}{{ block.settings.collection.featured_image | img_url: '720x' }} 720w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 940 -%}{{ block.settings.collection.featured_image | img_url: '940x' }} 940w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 1440 -%}{{ block.settings.collection.featured_image | img_url: '1440x' }} 1440w,{%- endif -%}
{%- if block.settings.collection.featured_image.width >= 1880 -%}{{ block.settings.collection.featured_image | img_url: '1880x' }} 1880w{%- endif -%}"
src="{{ block.settings.collection.featured_image | img_url: '533x' }}"
sizes="(min-width: 1100px){% if section.blocks.size > 1 %}535px{% else %}940px{% endif %}, (min-width: 750px) {% if section.blocks.size > 1 %}calc((100vw - 10rem) / 2){% else %}calc(100vw - 10rem){% endif %}, calc(100vw - 3rem)"
alt="{{ block.settings.collection.title | escape }}"
height="{{ block.settings.collection.image.height }}"
width="{{ block.settings.collection.image.width }}"
height="{{ block.settings.collection.featured_image.height }}"
width="{{ block.settings.collection.featured_image.width }}"
loading="lazy"
class="motion-reduce"
>
Expand Down
24 changes: 12 additions & 12 deletions sections/main-list-collections.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@
{%- for collection in collections -%}
<li class="collection-list__item grid__item">
<a{% if collection.all_products_count > 0 %} href="{{ collection.url }}"{% endif %}
class="card animate-arrow{% if collection.image != blank %} card--media{% else %}{% if section.settings.image_ratio != 'adapt' %} card--stretch{% endif %}{% endif %}{% unless section.settings.image_padding %} card--light-border{% endunless %}"
class="card animate-arrow{% if collection.featured_image != blank %} card--media{% else %}{% if section.settings.image_ratio != 'adapt' %} card--stretch{% endif %}{% endif %}{% unless section.settings.image_padding %} card--light-border{% endunless %}"
>
<div class="card--stretch card-colored color-{{ section.settings.color_scheme }}">
{%- if collection.image != blank -%}
{%- if collection.featured_image != blank -%}
<div{% if section.settings.image_padding %} class="card__media-spacer"{% endif %}>
{% if section.settings.image_padding %}<div class="overlay-card"></div>{% endif %}
<div class="media media--{{ section.settings.image_ratio }} media--hover-effect overflow-hidden"
{% if section.settings.image_ratio == 'adapt' %}style="padding-bottom: {{ 1 | divided_by: collection.image.aspect_ratio | times: 100 }}%;"{% endif %}>
{% if section.settings.image_ratio == 'adapt' %}style="padding-bottom: {{ 1 | divided_by: collection.featured_image.aspect_ratio | times: 100 }}%;"{% endif %}>

<img srcset="{%- if collection.image.width >= 165 -%}{{ collection.image | img_url: '165x' }} 165w,{%- endif -%}
{%- if collection.image.width >= 360 -%}{{ collection.image | img_url: '360x' }} 360w,{%- endif -%}
{%- if collection.image.width >= 535 -%}{{ collection.image | img_url: '535x' }} 535w,{%- endif -%}
{%- if collection.image.width >= 720 -%}{{ collection.image | img_url: '720x' }} 720w,{%- endif -%}
{%- if collection.image.width >= 940 -%}{{ collection.image | img_url: '940x' }} 940w,{%- endif -%}
{%- if collection.image.width >= 1070 -%}{{ collection.image | img_url: '1070x' }} 1070w{%- endif -%}"
src="{{ collection.image | img_url: '533x' }}"
<img srcset="{%- if collection.featured_image.width >= 165 -%}{{ collection.featured_image | img_url: '165x' }} 165w,{%- endif -%}
{%- if collection.featured_image.width >= 360 -%}{{ collection.featured_image | img_url: '360x' }} 360w,{%- endif -%}
{%- if collection.featured_image.width >= 535 -%}{{ collection.featured_image | img_url: '535x' }} 535w,{%- endif -%}
{%- if collection.featured_image.width >= 720 -%}{{ collection.featured_image | img_url: '720x' }} 720w,{%- endif -%}
{%- if collection.featured_image.width >= 940 -%}{{ collection.featured_image | img_url: '940x' }} 940w,{%- endif -%}
{%- if collection.featured_image.width >= 1070 -%}{{ collection.featured_image | img_url: '1070x' }} 1070w{%- endif -%}"
src="{{ collection.featured_image | img_url: '533x' }}"
sizes="(min-width: 1100px) 358px, (min-width: 750px) calc((100vw - 130px) / 3), calc(100vw - 30px)"
alt="{{ collection.title | escape }}"
height="{{ collection.image.height }}"
width="{{ collection.image.width }}"
height="{{ collection.featured_image.height }}"
width="{{ collection.featured_image.width }}"
loading="lazy"
>
</div>
Expand Down