Skip to content

Instantly share code, notes, and snippets.

@Dimls
Last active June 29, 2018 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dimls/8958ffa0ee883e4a0b6eef233febe9d6 to your computer and use it in GitHub Desktop.
Save Dimls/8958ffa0ee883e4a0b6eef233febe9d6 to your computer and use it in GitHub Desktop.
{% 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