Alternate theme layout for Online Store App Proxy

andrewchak
New Member
2 0 0

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)

0 Likes
SBD_
Shopify Staff
Shopify Staff
1044 141 185

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

0 Likes
andrewchak
New Member
2 0 0

Thanks Scotty, will give it a try and see if it works.

0 Likes
HunkyBill
Shopify Expert
4370 36 463

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.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes