Skip to content

Instantly share code, notes, and snippets.

@jimrothfork
Last active January 29, 2018 17:36
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 jimrothfork/23f891e8d700f7738a343cb509018694 to your computer and use it in GitHub Desktop.
Save jimrothfork/23f891e8d700f7738a343cb509018694 to your computer and use it in GitHub Desktop.
<!-- /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