We have developed a Shopify app with theme app extensions that use app blocks with schema settings (color pickers, image
pickers, etc.). These blocks work perfectly in Online Store 2.0 themes where merchants can add them via the theme editor.
However, we need to support merchants using vintage themes. We understand that app blocks with “target”: “section” don’t work
in vintage themes.
Questions:
Is there any way to make app blocks render programmatically in vintage themes?
Can we create a dual-mode block that uses block.settings in OS 2.0 but falls back to default values or metafields in
vintage themes?
What is the recommended approach for providing the same functionality to vintage theme users without requiring them to
manually copy/paste liquid code?
Can snippets from theme app extensions access block.settings when rendered manually via {% render %}?
Current structure:
Extension type: “theme”
Blocks in /blocks/ folder with {% schema %} settings
Target: “section”
Snippets in /snippets/ folder
We want to provide a seamless experience for both OS 2.0 and vintage theme users. What is the best practice for achieving
this?
Rendering App Blocks Programmatically in Vintage Themes
Unfortunately, app blocks can’t be injected or rendered programmatically in vintage themes.
Vintage themes don’t support the JSON templates or the dynamic block architecture required by the Theme App Extension framework. App blocks only work in OS 2.0 because of the section schema structure (/templates/*.json and section.settings).
Workaround:
For vintage themes, the only way to show dynamic content from your app is through:
@Omactech thanx for you response,
{% render ‘your-app-snippet’ %} can you tell me how to achieve that. I hav
e a snippet name ‘example‘, i write that inside the online shopify editor {% render ‘example’ %}. But in preview it says, snippet not exists. My app is a shopify app store deployed app (shopify extension app).