A space to discuss online store customization, theme development, and Liquid templating.
Hey guys,
I have a question around theming using App Proxy when creating a Private App.
According to the documentation:
https://shopify.dev/tutorials/display-data-on-an-online-store-with-an-application-proxy-app-extensio...
if we return a HTTP response from the proxy URL with the header Content-Type: application/liquid , Shopify will render any Liquid code in the request body in the context of the shop using the shop's theme.
While that's all good, by default it uses the default theme file (theme.liquid) when rendering.
My question is, is there any way to use an alternate theme file? (eg. theme.alternate.liquid). For example, are there any HTTP response headers that we can set to specify which file to use? (eg. X-Shopify-Theme)
Hey @andrewchak
I haven't seen this done before, but it might be possible - try including {% layout something %} in the response.
https://shopify.dev/docs/themes/liquid/reference/tags/theme-tags#layout
Scott | Developer Advocate @ Shopify
Thanks Scotty, will give it a try and see if it works.
I always thought the Liquid was rendered in the context of content_for_layout at which point it is too late to change theme. It is the sandwhich filling in the content, not the bread. Be interesting to see how that plays out.