App embed blocks not working inside capture tags

fransierra
Shopify Partner
5 0 0

Hello, 

 

we are using app embed blocks for our apps. They generally work great. However, we have found some cases where the content of the theme.liquid file is wrapped by a "capture" liquid tag, and in those cases the app embed blocks are not injected in the storefront. Could you please take a look?


Thanks in advance.

Replies 3 (3)
Liam
Shopify Staff
Shopify Staff
694 19 269

Hi Fransierra! Wrapping the content of the theme.liquid file in capture tags is not a pattern I've spotted before - which theme are you using? I'll also look into how best to work with app embed blocks in this context 🙂

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

fransierra
Shopify Partner
5 0 0

Hi Liam, 

 

our apps don't wrap the theme.liquid content, but we have found some clients with this situation, with themes such as Envy 26.4.0 or LangShop Theme 2.14.5. However, we don't think this is a theme feature, rather it may be caused by some third app.

Anyway, we find the theme.liquid file with situations like:

 

 

{%- capture minified -%}
<!DOCTYPE html>
<html lang="en">
  <head>
  ...
  </head>
  <body>
  ...
  </body>
</html>
{%- endcapture minified -%}

 

 

where the "minified" variable is used in other templates, causing app embed blocks not being injected.

 

Could you try it? Thanks in advance and kind regards.

 

Liam
Shopify Staff
Shopify Staff
694 19 269

I haven't seen this capture and minified as a theme dev pattern, but as you mention it's possible it's caused by an app. For example if you search the Shopify App Store for "minification" you'll find apps that affect theme Liquid files. Also since these are not themes on the theme store it's difficult for me to test easily. However I'll ask our product teams if they've encountered these use-case and how we can see how app embed blocks could operate in this context.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog