Gallery
{% assign sectionBorder = section.settings.border %}
{% assign textShadow = section.settings.text-shadow %}
{% if section.blocks.size == 0 %}
{% assign featureCount = 2 %}
{% else %}
{% assign featureCount = 0 %}
{% for block in section.blocks %}
{% assign featureCount = featureCount | plus: 1 %}
{% endfor %}
{% endif %}
{% schema %}
{
"name": "Gallery",
"max_blocks": 3,
"settings": [
{
"type": "text",
"id": "title",
"label": "Heading",
"default": "Image gallery"
},
{
"type": "checkbox",
"id": "border",
"label": "Show border",
"default": false
},
{
"type": "checkbox",
"id": "text-shadow",
"label": "Show text shadow",
"info": "Only appears when \"text shade\" is set to \"light\"."
}
],
"blocks": [
{
"type": "feature",
"name": "Image",
"settings": [
{
"type": "image_picker",
"id": "image",
"label": "Image",
"info": "1440 x 640px .jpg recommended"
},
{
"type": "text",
"id": "title",
"label": "Heading",
"default": "Image with text"
},
{
"type": "text",
"id": "text-above",
"label": "Subheading",
"default": "Subheading"
},
{
"type": "text",
"id": "text-below",
"label": "Text",
"default": "Text"
},
{
"type": "url",
"id": "url",
"label": "Link"
},
{
"type": "select",
"id": "text-color",
"label": "Text shade",
"options": [
{
"value": "light",
"label": "Light"
},
{
"value": "dark",
"label": "Dark"
}
],
"default": "light"
},
{
"type": "select",
"id": "text-position",
"label": "Align text",
"options": [
{
"value": "left",
"label": "Left"
},
{
"value": "center",
"label": "Center"
},
{
"value": "right",
"label": "Right"
}
],
"default": "center",
"info": "Will default to \"center\" if three features are shown in a row."
}
]
}
],
"presets": [
{
"category": "Image",
"name": "Gallery",
"blocks": [
{
"type": "feature"
},
{
"type": "feature"
}
]
}
]
}
{% endschema %}
{%
include 'home-section-title',
sectionTitle: section.settings.title,
%}
{% if section.blocks.size > 0 %}
{% for block in section.blocks %}
{% assign textAbove = block.settings.text-above | escape %}
{% assign heading = block.settings.title | escape %}
{% assign textBelow = block.settings.text-below | escape %}
{% assign url = block.settings.url %}
{% assign textColor = block.settings.text-color %}
{% assign textPosition = block.settings.text-position %}
{% assign image = block.settings.image %}
{%- capture image_html -%}
{% if image %}
{%
include 'rimg',
img: image,
size: '1440x640',
lazy: true
%}
{% else %}
{{ 'collection-1' | placeholder_svg_tag: 'placeholder-svg' }}
{% endif %}
{%- endcapture -%}
{% endfor %}
{% else %}
{% for i in (1..2) %}
{% endfor %}
{% endif %}