Hi,
I am using sense theme. I’m trying to add more options to the icon and text liquid block so that it will allow for me to have up to 6 items to use as USPs. It currently only has 3.
I’ve found the block and copied the sections to allow for more, but when I add the block in the product page template it doesn’t give me the fields to add more.
I feel like I also need to add somewhere that I need the fields to show but I can’t find where I would do that. I know I have got the right block as have added other text and it shows.
Below is my updated file: icon-with-text.liquid
{% comment %}
Renders icon with text block
Accepts:
- block: {Object} passes in the block information.
Usage:
{% render 'icon-with-text',
block: block
%}
{% endcomment %}
{%- liquid
assign heading_1_empty = false
assign heading_2_empty = false
assign heading_3_empty = false
assign heading_4_empty = false
assign heading_5_empty = false
assign heading_6_empty = false
assign text_only_all_items = true
if block.settings.heading_1 == empty
assign heading_1_empty = true
endif
if block.settings.heading_2 == empty
assign heading_2_empty = true
endif
if block.settings.heading_3 == empty
assign heading_3_empty = true
endif
if block.settings.heading_4 == empty
assign heading_4_empty = true
endif
if block.settings.heading_5 == empty
assign heading_5_empty = true
endif
if block.settings.heading_6 == empty
assign heading_6_empty = true
endif
if heading_1_empty == false and block.settings.icon_1 != 'none' or block.settings.image_1 != null
assign text_only_all_items = false
elsif heading_2_empty == false and block.settings.icon_2 != 'none' or block.settings.image_2 != null
assign text_only_all_items = false
elsif heading_3_empty == false and block.settings.icon_3 != 'none' or block.settings.image_3 != null
assign text_only_all_items = false
elsif heading_4_empty == false and block.settings.icon_4 != 'none' or block.settings.image_4 != null
assign text_only_all_items = false
elsif heading_5_empty == false and block.settings.icon_5 != 'none' or block.settings.image_5 != null
assign text_only_all_items = false
elsif heading_6_empty == false and block.settings.icon_6 != 'none' or block.settings.image_6 != null
assign text_only_all_items = false
endif
-%}
<ul
class="icon-with-text icon-with-text--{{ block.settings.layout }} list-unstyled{% if text_only_all_items %} icon-with-text--text-only{% endif %}"
{{ block.shopify_attributes }}
>
<!-- HEADING 1 -->
{%- unless heading_1_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_1 == null -%}
{%- render 'icon-accordion', icon: block.settings.icon_1 -%}
{%- else -%}
<img
src="{{ block.settings.image_1 | image_url }}"
{% if block.settings.image_1.alt != blank %}
alt="{{ block.settings.image_1.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_1 -}}
</span>
</li>
{%- endunless -%}
<!-- HEADING 2 -->
{%- unless heading_2_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_2 == null -%}
{% render 'icon-accordion', icon: block.settings.icon_2 -%}
{%- else -%}
<img
src="{{ block.settings.image_2 | image_url }}"
{% if block.settings.image_2.alt != blank %}
alt="{{ block.settings.image_2.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_2 -}}
</span>
</li>
{%- endunless -%}
<!-- HEADING 3 -->
{%- unless heading_3_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_3 == null -%}
{% render 'icon-accordion', icon: block.settings.icon_3 -%}
{%- else -%}
<img
src="{{ block.settings.image_3 | image_url }}"
{% if block.settings.image_3.alt != blank %}
alt="{{ block.settings.image_3.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_3 -}}
</span>
</li>
{%- endunless -%}
<!-- HEADING 4 -->
{%- unless heading_4_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_4 == null -%}
{% render 'icon-accordion', icon: block.settings.icon_4 -%}
{%- else -%}
<img
src="{{ block.settings.image_4 | image_url }}"
{% if block.settings.image_4.alt != blank %}
alt="{{ block.settings.image_4.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_4 -}}
hello
</span>
</li>
{%- endunless -%}
<!-- HEADING 5 -->
{%- unless heading_5_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_5 == null -%}
{% render 'icon-accordion', icon: block.settings.icon_5 -%}
{%- else -%}
<img
src="{{ block.settings.image_5 | image_url }}"
{% if block.settings.image_5.alt != blank %}
alt="{{ block.settings.image_5.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_5 -}}
</span>
</li>
{%- endunless -%}
<!-- HEADING 6 -->
{%- unless heading_6_empty -%}
<li class="icon-with-text__item">
{%- if block.settings.image_6 == null -%}
{% render 'icon-accordion', icon: block.settings.icon_6 -%}
{%- else -%}
<img
src="{{ block.settings.image_6 | image_url }}"
{% if block.settings.image_6.alt != blank %}
alt="{{ block.settings.image_6.alt | escape }}"
{% else %}
role="presentation"
{% endif %}
height="auto"
width="auto"
loading="lazy"
>
{%- endif -%}
<span class="h4 inline-richtext">
{{- block.settings.heading_6 -}}
</span>
</li>
{%- endunless -%}
</ul>
