Converting a static section to dynamic, visible on home page only

Hi guys, hope everyone is safe and well.

We use the Warehouse theme by Maestroo, and it comes with a “text with icons” static section which is coded to sit above the footer in every page on our site.

I’d much rather this section be:

A) A dynamic section which I can place wherever I want
B) Only visible on the home page (I want to place it immediately below our main banner on our home page).

Below you’ll find the code for the section in question. If anyone could help me out I’d really appreciate it!

SECTION STARTS HERE:

{%- if section.settings.show_section -%}

{%- for block in section.blocks -%}
{%- if block.settings.custom_icon != blank -%} {{ block.settings.custom_icon.alt | escape }} {%- else -%} {%- render 'icon', icon: block.settings.icon, stroke_width: 1.5 -%} {%- endif -%}

{%- if block.settings.title != blank or block.settings.content != blank -%}

{%- if block.settings.title != blank -%}

{{ block.settings.title | escape }}

{%- endif -%}

{%- if block.settings.content != blank -%}

{{ block.settings.content }}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}

{% schema %}
{
“name”: “Text with icons”,
“max_blocks”: 4,
“settings”: [
{
“type”: “checkbox”,
“id”: “show_section”,
“label”: “Show section”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “stack_mobile”,
“label”: “Stack on mobile”,
“default”: false
}
],
“blocks”: [
{
“type”: “item”,
“name”: “Item”,
“settings”: [
{
“type”: “select”,
“id”: “icon”,
“label”: “Icon”,
“options”: [
{
“value”: “bi-add-to-cart”,
“label”: “Add to cart”,
“group”: “Shop”
},
{
“value”: “bi-gift-wrap”,
“label”: “Gift wrap”,
“group”: “Shop”
},
{
“value”: “bi-gift-box”,
“label”: “Gift box”,
“group”: “Shop”
},
{
“value”: “bi-heart”,
“label”: “Heart”,
“group”: “Shop”
},
{
“value”: “bi-ecology”,
“label”: “Ecology”,
“group”: “Shop”
},
{
“value”: “bi-plant”,
“label”: “Plant”,
“group”: “Shop”
},
{
“value”: “bi-shop”,
“label”: “Shop”,
“group”: “Shop”
},
{
“value”: “bi-shop-pin”,
“label”: “Shop with pin”,
“group”: “Shop”
},
{
“value”: “bi-alert”,
“label”: “Alert”,
“group”: “Communication”
},
{
“value”: “bi-chat”,
“label”: “Chat”,
“group”: “Communication”
},
{
“value”: “bi-comment”,
“label”: “Comment”,
“group”: “Communication”
},
{
“value”: “bi-customer-support”,
“label”: “Customer support”,
“group”: “Communication”
},
{
“value”: “bi-email”,
“label”: “Email”,
“group”: “Communication”
},
{
“value”: “bi-network”,
“label”: “Network”,
“group”: “Communication”
},
{
“value”: “bi-newsletter”,
“label”: “Newsletter”,
“group”: “Communication”
},
{
“value”: “bi-love”,
“label”: “Love”,
“group”: “Communication”
},
{
“value”: “bi-phone”,
“label”: “Phone”,
“group”: “Communication”
},
{
“value”: “bi-share”,
“label”: “Share”,
“group”: “Communication”
},
{
“value”: “bi-delivery”,
“label”: “Delivery”,
“group”: “Delivery”
},
{
“value”: “bi-fast-delivery”,
“label”: “Fast delivery”,
“group”: “Delivery”
},
{
“value”: “bi-returns”,
“label”: “Returns”,
“group”: “Delivery”
},
{
“value”: “bi-time”,
“label”: “Time”,
“group”: “Delivery”
},
{
“value”: “bi-secure-payment”,
“label”: “Secure payment”,
“group”: “Security”
},
{
“value”: “bi-mobile-payment”,
“label”: “Mobile payment”,
“group”: “Security”
},
{
“value”: “bi-computer-payment”,
“label”: “Computer payment”,
“group”: “Security”
},
{
“value”: “bi-credit-card”,
“label”: “Credit card”,
“group”: “Security”
},
{
“value”: “bi-shield”,
“label”: “Shield”,
“group”: “Security”
}
],
“default”: “bi-customer-support”
},
{
“type”: “image_picker”,
“id”: “custom_icon”,
“label”: “Custom icon”,
“info”: “60 x 60px .png with transparency recommended”
},
{
“type”: “text”,
“id”: “title”,
“label”: “Heading”,
“default”: “Your title”
},
{
“type”: “richtext”,
“id”: “content”,
“label”: “Content”,
“default”: “

Short content about your store


}
]
}
],
“default”: {
“blocks”: [
{
“type”: “item”,
“settings”: {
“icon”: “bi-delivery”,
“title”: “Free delivery worldwide”
}
},
{
“type”: “item”,
“settings”: {
“icon”: “bi-returns”,
“title”: “Satisfied or refunded”
}
},
{
“type”: “item”,
“settings”: {
“icon”: “bi-customer-support”,
“title”: “Top-notch support”
}
},
{
“type”: “item”,
“settings”: {
“icon”: “bi-secure-payment”,
“title”: “Secure payments”
}
}
]
}
}
{% endschema %}

Hi @UK_Aspire_Vendo

Can you show us what you mean

As above - we have a static section included with our theme (code above).

I wish to turn that into a dynamic section, but have it visible on only the home page!

Anyone available to help on this?

Anyone??

Hi @UK_Aspire_Vendo

I’ll be honest, your question is very confusing tbh.

Email me with all the pictures of samples of what you need done

This is the static section in question:

it’s known as ‘text with icons’ in our theme editor:

As a static section, I’m forced to have it stay at the bottom of every page, I cannot move it anywhere (see 1st screenshot)

I would like to re-position it so that it sits directly below our main banner on our home page, and appear nowhere else on the site (below is where I would like it to go)

Any help anyone?

Hi @UK_Aspire_Vendo

Stumped on this one, and too much missing parts to find out how to include it in the homepage as a dynamic

So far, I know that the index.liquid is for the home page, it contains 1 line with {{ content_for_index }}

This is also called out in the theme.liquid with {{ content_for_layout }}

Can’t find much after this.

Might be a little late, but rather late than never! :sweat_smile:

To convert a section from static to dynamic, you have to switch out the “default” under Schema, to “presets”.

Then under presets, add an object with the key/values as such:

[
{
“category”: “”,

“name”: “”,

“blocks”: [

<Add example of blocks, if needed>
]
}
]

Hope this helps others that are also in search of converting static sections to dynamic sections :oncoming_fist: