Generate Blocks in Any Theme
I made a section that allows any theme to access the new Generate Blocks functionality introduced in the recent Shopify Editions Summer '25 shown here: https://www.shopify.com/editions/summer2025#generate-theme-blocks-with-ai
It is basically just a section that uses theme blocks i.e. “@theme” as a block type in the section’s schema and then outputs the theme blocks with {% content_for ‘blocks’ %}
For example:
{% content_for 'blocks' %}
{% schema %}
...
"blocks": [
{
"type": "@theme"
}
],
...
{% endschema %}
Note: You can’t use “@theme” blocks and blocks defined the schema in a section at the same time.
Instructions:### 1. Add the ai-powered-section.liquid file to the “sections” folder in your theme files
Ai-powered-section.liquid:
{% content_for 'blocks' %}
{% schema %}
{
"name": "AI-Powered Section",
"blocks": [
{
"type": "@theme"
}
],
"settings": [
{
"type": "header",
"content": "Instructions",
"info": "Add a block to this section, then select Generate."
},
{
"type": "header",
"content": "Settings",
"info": "There are no settings for this section. Try checking the generated blocks."
}
],
"presets": [
{
"name": "AI-Powered Section"
}
]
}
{% endschema %}
2. Add the section to your theme and start generating custom blocks with A.I.
Bonus Tips
Bonus tip 1: If your custom blocks aren’t aligning with the layout of the rest of your content then ask the A.I. to add a setting that allows you to align the block.
Note: Follow up instructions are only available before saving the block to the theme files.
Ex follow up prompt 1: Could you add a page width setting.
Ex follow up prompt 2: Could you add a setting that let’s me align the content in the center.
Bonus tip 2: If you know how to code and want to try editing the code for the generated block directly you can navigate to the file quickly by right clicking the block and selecting “Edit code”
Note: “Edit code” is only available after the generated block has been saved to the theme files by clicking “Save”





