Hi I am still looking for a bit of help with this code. Can anyone help please?
{% if section.settings.heading_text != blank %}
## {{ section.settings.heading_text | escape }}
{% endif %}
{% for block in section.blocks %}
{% case block.settings.width %}
{% when '25%' %}
{%- assign block_width = 'medium-up--one-quarter' -%}
{% when '33%' %}
{%- assign block_width = 'medium-up--one-third' -%}
{% when '50%' %}
{%- assign block_width = 'medium-up--one-half' -%}
{% when '66%' %}
{%- assign block_width = 'medium-up--two-thirds' -%}
{% when '75%' %}
{%- assign block_width = 'medium-up--three-quarters' -%}
{% when '100%' %}
{%- assign block_width = 'one-whole' -%}
{% endcase %}
{% case block.type %}
{% when 'image' %}
{% comment %}
Custom Image Block
{% endcomment %}
{% if block.settings.image != blank %}
{% assign img_url = block.settings.image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' %}
{% else %}
{{ 'image' | placeholder_svg_tag: 'placeholder-svg' }}
{% endif %}
{% when 'text' %}
{% comment %}
Custom Text Block
{% endcomment %}
{% if block.settings.heading_text != blank %}
## {{ block.settings.heading_text | escape }}
{% endif %}
{% if block.settings.paragraph_text != blank %}
{{ block.settings.paragraph_text }}
{% endif %}
{% endcase %}
{% endfor %}
{% if section.blocks.size == 0 %}
{% include 'no-blocks' %}
{% endif %}
{% schema %}
{
"name": {
"en": "Custom content"
},
"class": "index-section index-section--custom-content",
"settings": [
{
"type": "text",
"id": "heading_text",
"label": {
"en": "Heading"
},
"default": {
"en": "Custom content"
}
},
{
"type": "color",
"id": "heading_color",
"label": {
"en": "Heading color"
},
"default": "#242424"
},
{
"type": "color",
"id": "background_color",
"label": {
"en": "Background color"
}
},
{
"type": "checkbox",
"id": "top_margin",
"label": {
"en": "Top margin"
},
"default": true
},
{
"type": "checkbox",
"id": "bottom_margin",
"label": {
"en": "Bottom margin"
},
"default": true
}
],
"blocks": [
{
"type": "text",
"name": {
"en": "Text"
},
"settings": [
{
"type": "header",
"content": {
"en": "Heading"
}
},
{
"type": "text",
"id": "heading_text",
"label": {
"en": "Text"
},
"default": {
"en": "Talk about your brand"
}
},
{
"type": "color",
"id": "heading_color",
"label": {
"en": "Color"
},
"default": "#242424"
},
{
"type": "select",
"id": "heading_style",
"label": {
"en": "Style"
},
"default": "h3",
"options": [
{
"value": "h1",
"label": {
"en": "Heading 1"
}
},
{
"value": "h2",
"label": {
"en": "Heading 2"
}
},
{
"value": "h3",
"label": {
"en": "Heading 3"
}
},
{
"value": "h4",
"label": {
"en": "Heading 4"
}
},
{
"value": "h5",
"label": {
"en": "Heading 5"
}
},
{
"value": "h6",
"label": {
"en": "Heading 6"
}
}
]
},
{
"type": "header",
"content": {
"en": "Paragraph"
}
},
{
"type": "richtext",
"id": "paragraph_text",
"label": {
"en": "Text"
},
"default": {
"en": "
Use this text to share information about your brand with your customers. Describe a product, share announcements, or welcome customers to your store.
"
}
},
{
"type": "color",
"id": "paragraph_color",
"label": {
"en": "Color"
},
"default": "#4a4a4a"
},
{
"type": "select",
"id": "paragraph_size",
"label": {
"en": "Size"
},
"default": "1",
"options": [
{
"value": "1",
"label": {
"en": "Medium"
}
},
{
"value": "1.25",
"label": {
"en": "Large"
}
},
{
"value": "1.5",
"label": {
"en": "Extra large"
}
}
]
},
{
"type": "header",
"content": {
"en": "Layout"
}
},
{
"type": "select",
"id": "width",
"label": {
"en": "Container width"
},
"default": "50%",
"options": [
{
"value": "25%",
"label": {
"en": "25%"
}
},
{
"value": "33%",
"label": {
"en": "33%"
}
},
{
"value": "50%",
"label": {
"en": "50%"
}
},
{
"value": "66%",
"label": {
"en": "66%"
}
},
{
"value": "75%",
"label": {
"en": "75%"
}
},
{
"value": "100%",
"label": {
"en": "100%"
}
}
]
},
{
"type": "select",
"id": "alignment",
"label": {
"en": "Vertical alignment"
},
"info": {
"en": "Position relative to other content blocks on the same row"
},
"default": "center",
"options": [
{
"value": "top",
"label": {
"en": "Top"
}
},
{
"value": "center",
"label": {
"en": "Middle"
}
},
{
"value": "bottom",
"label": {
"en": "Bottom"
}
}
]
},
{
"type": "select",
"id": "align_text",
"label": {
"en": "Horizontal alignment"
},
"default": "left",
"options": [
{
"value": "left",
"label": {
"en": "Left"
}
},
{
"value": "center",
"label": {
"en": "Centered"
}
},
{
"value": "right",
"label": {
"en": "Right"
}
}
]
}
]
},
{
"type": "image",
"name": {
"en": "Image"
},
"settings": [
{
"type": "image_picker",
"id": "image",
"label": {
"en": "Image"
}
},
{
"type": "header",
"content": {
"en": "Layout"
}
},
{
"type": "select",
"id": "width",
"label": {
"en": "Container width"
},
"default": "50%",
"options": [
{
"value": "25%",
"label": {
"en": "25%"
}
},
{
"value": "33%",
"label": {
"en": "33%"
}
},
{
"value": "50%",
"label": {
"en": "50%"
}
},
{
"value": "66%",
"label": {
"en": "66%"
}
},
{
"value": "75%",
"label": {
"en": "75%"
}
},
{
"value": "100%",
"label": {
"en": "100%"
}
}
]
},
{
"type": "select",
"id": "alignment",
"label": {
"en": "Vertical alignment"
},
"info": {
"en": "Position relative to other content blocks on the same row"
},
"default": "center",
"options": [
{
"value": "top",
"label": {
"en": "Top"
}
},
{
"value": "center",
"label": {
"en": "Middle"
}
},
{
"value": "bottom",
"label": {
"en": "Bottom"
}
}
]
}
]
},
{
"type": "collection",
"name": {
"en": "Collection"
},
"settings": [
{
"type": "collection",
"id": "collection",
"label": {
"en": "Collection"
}
},
{
"type": "header",
"content": {
"en": "Layout"
}
},
{
"type": "select",
"id": "width",
"label": {
"en": "Container width"
},
"default": "50%",
"options": [
{
"value": "25%",
"label": {
"en": "25%"
}
},
{
"value": "33%",
"label": {
"en": "33%"
}
},
{
"value": "50%",
"label": {
"en": "50%"
}
},
{
"value": "66%",
"label": {
"en": "66%"
}
},
{
"value": "75%",
"label": {
"en": "75%"
}
},
{
"value": "100%",
"label": {
"en": "100%"
}
}
]
},
{
"type": "select",
"id": "alignment",
"label": {
"en": "Vertical alignment"
},
"info": {
"en": "Position relative to other content blocks on the same row"
},
"default": "center",
"options": [
{
"value": "top",
"label": {
"en": "Top"
}
},
{
"value": "center",
"label": {
"en": "Middle"
}
},
{
"value": "bottom",
"label": {
"en": "Bottom"
}
}
]
}
]
}
],
"presets": [
{
"name": {
"en": "Custom content"
},
"blocks": [
{
"type": "text"
},
{
"type": "image"
}
]
}
]
}
{% endschema %}
I am wanting the image to be included in the same block as the heading and text so I can have an icon above the heading and text.