Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!-- /sections/pages.liquid -->
<div class="grid--full">
{% assign banLimit = 0 %}
{% for block in section.blocks %}
{% if block.settings.page-feature != blank %}
{% if block.settings.page-feature == page.handle and banLimit<1 %}
{%assign banLimit = banLimit | plus: 1 %}
<div class="blog-featured-image" style="background-color: white; {% if block.settings.banimage %}background-image: url({{ block.settings.banimage | img_url: '1920x', format: 'pjpg' }}); height: 400px;{% else %}{% endif %};"></div>
{% endif %}
{% else %}
{%if banLimit < 1%}
{%assign banLimit = banLimit | plus: 1 %}
<div class="blog-featured-image" style="background-color: white; {% if block.settings.banimage %}background-image: url({{ block.settings.banimage | img_url: '1920x', format: 'pjpg' }}); height: 400px;{% else %}{% endif %};"></div>
{% endif %}
{% endif %}
{% endfor %}
<div class="grid--full page-wrapper">
<div class="grid__item large--two-thirds push--large--one-sixth">
<h1 class="page-title">{{ page.title }}</h1>
{% comment %}
Regular page content goes here.
{% endcomment %}
<div class="rte page-text">
{{ page.content }}
</div>
</div>
</div>
</div>
{% schema %}
{
"name": "Pages",
"settings": [],
"blocks": [
{
"type": "image",
"name": "Page banner",
"settings": [
{
"type": "page",
"id": "page-feature",
"label": "Page"
},
{
"type": "image_picker",
"id": "banimage",
"label": "Banner image",
"info": "1920 x 400px .png recommended"
}
]
}
]
}
{% endschema %}
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.