Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{% if forloop.index == 2 and section.settings.collection-ad-text_richtext != '' or forloop.index == 2 and section.settings.collection-image %}
<div id="gridparentad" class="grid__item collection-ad-mobile margin-B-M {{ collection_products_per_row }} quarter-width product-square-grid-ad medium--one-half ff small--one-whole product-grid-square">
<div id="dummy"></div>
<div class="{%if section.settings.collection-image == blank %} collection-page-ad{% endif %}
card-shadow collection-product collection-box-1
{%if section.settings.collection-image != blank %}grid__image col-image{%endif%}
" id="element">
{%if section.settings.collection-image%}
{%if section.settings.collection-ad-link != blank%}
<a href="{{section.settings.collection-ad-link}}">
{%endif%}
<img src="{{ section.settings.collection-image| img_url: '1024x1024' }}">
{%if section.settings.collection-ad-link != blank%}
<div class="product-overlay" style="margin:0;">
<div class="product-grid-card-link">
{{ section.settings.collection-ad-text_richtext | truncatewords:10 }}
</div>
</div>
</a>
{%endif%}
{%else%}
<div class="collection-ad-text rte">
<h1>{{ section.settings.collection-ad-text_richtext }}</h1>
</div>
{% endif %}
</div>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.