test

{% if section.settings.title != blank %}

{{ section.settings.title | escape }}

{% endif %}
{% for block in section.blocks %} {% case block.settings.width %} {% when '25%' %} {%- assign max_height = 250 -%} {%- assign block_width = 'small--one-half medium-up--one-quarter' -%} {% when '33%' %} {%- assign max_height = 345 -%} {%- assign block_width = 'small--one-half medium-up--one-third' -%} {% when '50%' %} {%- assign max_height = 530 -%} {%- assign block_width = 'small--one-half medium-up--one-half' -%} {% when '66%' %} {%- assign max_height = 720 -%} {%- assign block_width = 'two-thirds' -%} {% when '75%' %} {%- assign max_height = 810 -%} {%- assign block_width = 'three-quarters' -%} {% when '100%' %} {%- assign max_height = 1090 -%} {%- assign block_width = 'one-whole' -%} {% endcase %} {% if block.type == 'image' %} {% capture img_id %}CustomImage--{{ forloop.index }}-{{ block.settings.image.id }}{% endcapture %} {% capture img_wrapper_id %}CustomImageWrapper--{{ forloop.index }}-{{ block.settings.image.id }}{% endcapture %} {% unless block.settings.image == blank %} {% include 'image-style' with image: block.settings.image, small_style: false, width: max_height, height: max_height, wrapper_id: img_wrapper_id, img_id: img_id %} {% endunless %} {% endif %}
{% case block.type %} {% when 'image' %} {% if block.settings.image != blank %} {%- assign img_url = block.settings.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{{ block.settings.image.alt | escape }}
{% else %} {{ 'image' | placeholder_svg_tag: 'placeholder-svg' }} {% endif %} {% when 'text' %}
{% if block.settings.title != blank %}

{{ block.settings.title | escape }}

{% endif %} {% if block.settings.text != blank %}
{{ block.settings.text }}
{% endif %}
{% when 'video' %}
{% if block.settings.video_url == blank %} {% else %} {% if block.settings.video_url.type == "youtube" %} {% endif %} {% if block.settings.video_url.type == "vimeo" %} {% endif %} {% endif %}
{% when 'product' %} {%- assign product = all_products [block.settings.product] -%} {% if product.title.size > 0 %} {% include 'product-card-grid', max_height: max_height %} {% else %} {% comment %} No product yet. Show onboarding one. {% endcomment %} {% endif %} {% when 'collection' %} {%- assign collection = collections [block.settings.collection] -%} {% include 'collection-grid-item' %} {% when 'html' %} {% if block.settings.code != blank %} {{ block.settings.code }} {% endif %} {% endcase %}
{% endfor %}
{% if section.blocks.size == 0 %} {% include 'no-blocks' %} {% endif %}
{% schema %} { "name": "Custom content", "class": "index-section", "settings": [ { "type": "text", "id": "title", "label": "Heading", "default": "Custom content" } ] , "blocks": [ { "type": "text", "name": "Text", "settings": ] [ { "type": "text", "id": "title", "label": "Heading", "default": "Talk about your brand" }, { "type": "richtext", "id": "text", "label": "Text", "default": "

Use this text to share information about your brand with your customers. Describe a product, share announcements, or welcome customers to your store.

" }, { "type": "select", "id": "width", "label": "Container width", "default": "50%", "options": ] [ { "value": "25%", "label": "25%" }, { "value": "33%", "label": "33%" }, { "value": "50%", "label": "50%" }, { "value": "66%", "label": "66%" }, { "value": "75%", "label": "75%" }, { "value": "100%", "label": "100%" } ] }, { "type": "select", "id": "alignment", "label": "Vertical alignment", "default": "center", "options": [ {"value": "top-middle", "label": "Top"}, {"value": "center", "label": "Middle"}, {"value": "bottom-middle", "label": "Bottom"} ] }, { "type": "select", "id": "align_text", "label": "Horizontal alignment", "default": "left", "options": [ {"value": "left", "label": "Left"}, {"value": "center", "label": "Centered"}, {"value": "right", "label": "Right"} ] } [ { "type": "image_picker", "id": "image", "label": "Image" }, { "type": "select", "id": "width", "label": "Container width", "default": "50%", "options": ] [ { "value": "25%", "label": "25%" }, { "value": "33%", "label": "33%" }, { "value": "50%", "label": "50%" }, { "value": "66%", "label": "66%" }, { "value": "75%", "label": "75%" }, { "value": "100%", "label": "100%" } ] }, { "type": "select", "id": "alignment", "label": "Vertical alignment", "default": "center", "options": [ { "value": "top-left", "label": "Top left" }, { "value": "top-middle", "label": "Top middle" }, { "value": "top-right", "label": "Top right" }, { "value": "middle-left", "label": "Middle left" }, { "value": "center", "label": "Middle" }, { "value": "middle-right", "label": "Middle right" }, { "value": "bottom-left", "label": "Bottom left" }, { "value": "bottom-middle", "label": "Bottom middle" }, { "value": "bottom-right", "label": "Bottom right" } ] } [ { "type": "video_url", "id": "video_url", "label": "YouTube or Vimeo link", "accept": ] ["youtube", "vimeo"] }, { "type": "select", "id": "width", "label": "Container width", "default": "100%", "options": [ { "value": "25%", "label": "25%" }, { "value": "33%", "label": "33%" }, { "value": "50%", "label": "50%" }, { "value": "66%", "label": "66%" }, { "value": "75%", "label": "75%" }, { "value": "100%", "label": "100%" } ] }, { "type": "select", "id": "alignment", "label": "Vertical alignment", "default": "top-middle", "options": [ { "value": "top-middle", "label": "Top" }, { "value": "center", "label": "Middle" }, { "value": "bottom-middle", "label": "Bottom" } ] } [ { "type": "product", "id": "product", "label": "Product" }, { "type": "select", "id": "width", "label": "Container width", "default": "50%", "options": ] [ { "value": "25%", "label": "25%" }, { "value": "33%", "label": "33%" }, { "value": "50%", "label": "50%" }, { "value": "66%", "label": "66%" }, { "value": "75%", "label": "75%" }, { "value": "100%", "label": "100%" } ] }, { "type": "select", "id": "alignment", "label": "Vertical alignment", "default": "center", "options": [ { "value": "top-left", "label": "Top left" }, { "value": "top-middle", "label": "Top middle" }, { "value": "top-right", "label": "Top right" }, { "value": "middle-left", "label": "Middle left" }, { "value": "center", "label": "Middle" }, { "value": "middle-right", "label": "Middle right" }, { "value": "bottom-left", "label": "Bottom left" }, { "value": "bottom-middle", "label": "Bottom middle" }, { "value": "bottom-right", "label": "Bottom right" } ] } [ { "type": "collection", "id": "collection", "label": "Collection" }, { "type": "select", "id": "width", "label": "Container width", "default": "50%", "options": ] [ { "value": "25%", "label": "25%" }, { "value": "33%", "label": "33%" }, { "value": "50%", "label": "50%" }, { "value": "66%", "label": "66%" }, { "value": "75%", "label": "75%" }, { "value": "100%", "label": "100%" } ] } [ { "type": "html", "id": "code", "label": "HTML" }, { "type": "select", "id": "width", "label": "Container width", "default": "50%", "options": ] [ { "value": "25%", "label": "25%" }, { "value": "33%", "label": "33%" }, { "value": "50%", "label": "50%" }, { "value": "66%", "label": "66%" }, { "value": "75%", "label": "75%" }, { "value": "100%", "label": "100%" } ] } [ { "name": "Custom content", "category": "Advanced layout", "blocks": ] [ { "type": "text" }, { "type": "image" } ] }