Generate Blocks in Any Theme

Topic summary

A workaround enables AI-powered block generation (a feature from Shopify Editions Summer '25) in any Shopify theme, not just those natively supporting it.

Implementation method:

  • Create a custom section file (ai-powered-section.liquid) in the theme’s sections folder
  • Use "type": "@theme" in the section schema’s blocks array
  • Output blocks with {% content_for 'blocks' %}
  • Note: Cannot mix @theme blocks with custom-defined blocks in the same section

Workflow:

  1. Add the section file to theme
  2. Add section to a page in the theme editor
  3. Use “Generate” option to create AI-powered blocks

Additional tips:

  • Request layout/alignment settings via follow-up prompts before saving (e.g., “add a page width setting”)
  • Access generated block code directly via right-click → “Edit code” after saving
  • Follow-up instructions only work before saving blocks to theme files

The solution received positive feedback from community members.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

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”

1 Like

It’s useful. Thank @DrewOswald :clap:

1 Like

Sorry about the broken link. Here’s the correct one: https://www.shopify.com/editions/summer2025#generate-theme-blocks-with-ai