All things Shopify and commerce
Hi all, I want to create a new section in the Dawn Theme as shown in the screenshot below
I've tried to create it in the theme with the custom liquid code but getting an error. Can someone guide me on what am I doing wrong and how can I fix that?
<div class="iconContainer"> <div class="iconBox"> <div class="icon"> <img src=" {{ block.settings.icon | image_url: width: 3840 | image_tag: height: height, sizes: sizes, widths: widths, fetchpriority: fetch_priority }} " height="100" width="100" > {{ block.settings.icon | image_url }} </div> <div class="iconTextBox"> {%- if block.settings.iconName != blank -%} <h5 class="iconName iconText">{{ block.settings.iconName }}</h5> {%- endif -%} {%- if block.settings.iconTagline != blank -%} <h5 class="iconTagline iconText">{{ block.settings.iconTagline }}</h5> {% endif %} </div> </div> </div> {%- style -%} .iconContainer{ display: flex; align-items: center; justify-content: space-evenly; flex-wrap: wrap; } .iconBox{ width: 150px; height: 150px; } {%- endstyle -%} {% schema %} { "name": "Footer Icons", "class": "section", "tag": "section", "blocks": [ { "type": "column", "name": "Icon Box", "settings": [ { "type": "image_picker", "id": "icon", "label": "Icon", "info": "Icon image to be uploaded here" }, { "type": "richtext", "id": "iconName", "label": "Icon Name" }, { "type": "richtext", "id": "iconTagline", "label": "Icon Tagline" } ] } ], "presets": [ { "name": "Footer Icons" }]} {% endschema %}
Error:
1. It's showing unknow object block used in line 6,
2. On the Frontend showing invalid url
Solved! Go to the solution
This is an accepted solution.
Hi @Kushagra0602 ,
It seems you are missing a crucial step of calling the block loop before outputting the content , Please refer to the code below
{% for block in section.blocks %}
<div class="iconContainer">
<div class="iconBox">
<div class="icon">
<img
src="{{ block.settings.icon | image_url: width: 3840 | image_tag: height: height, sizes: sizes, widths: widths, fetchpriority: fetch_priority }}"
height="100"
width="100"
>
{{ block.settings.icon | image_url }}
</div>
<div class="iconTextBox">
{%- if block.settings.iconName != blank -%}
<h5 class="iconName iconText">{{ block.settings.iconName }}</h5>
{%- endif -%}
{%- if block.settings.iconTagline != blank -%}
<h5 class="iconTagline iconText">{{ block.settings.iconTagline }}</h5>
{%- endif -%}
</div>
</div>
</div>
{% endfor %}
This is an accepted solution.
Hi @Kushagra0602 ,
It seems you are missing a crucial step of calling the block loop before outputting the content , Please refer to the code below
{% for block in section.blocks %}
<div class="iconContainer">
<div class="iconBox">
<div class="icon">
<img
src="{{ block.settings.icon | image_url: width: 3840 | image_tag: height: height, sizes: sizes, widths: widths, fetchpriority: fetch_priority }}"
height="100"
width="100"
>
{{ block.settings.icon | image_url }}
</div>
<div class="iconTextBox">
{%- if block.settings.iconName != blank -%}
<h5 class="iconName iconText">{{ block.settings.iconName }}</h5>
{%- endif -%}
{%- if block.settings.iconTagline != blank -%}
<h5 class="iconTagline iconText">{{ block.settings.iconTagline }}</h5>
{%- endif -%}
</div>
</div>
</div>
{% endfor %}
Thanks for the help. 🙂
Thanks for the help buddy. 🙂
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025