A space to discuss online store customization, theme development, and Liquid templating.
Hi there,
I'm implementing this process for my app:
https://shopify.dev/apps/online-store/verify-support#verify-support-for-app-blocks
I am trying to determine if the customer's theme supports app blocks. The code seems to be working fine, however I'm confused because the default 2.0 theme (Dawn) is outputting:
"All desired templates support sections everywhere!
Only some of the desired templates support app blocks."
This doesn't seem right? I would have assumed that the reference theme has full support for app blocks? I am targeting "product" and "cart" templates specifically.
Does this mean I can look at the first templates check only, and not the second one that checks for @app support? I seem to be able to add my app block to the cart page, even though it apparently doesn't support them.
Any clarification around this would be awesome, as I'm using it to determine whether or not to register ScriptTags.
Thanks,
Jay.
Solved! Go to the solution
This is an accepted solution.
I never found much info surrounding this, but ended up just trusting the first check (do the templates support sections), and skipping the second part.
So far haven't seen any issues with detection using this method. Still would love to hear if anyone has found otherwise or has other solutions.
This is an accepted solution.
I never found much info surrounding this, but ended up just trusting the first check (do the templates support sections), and skipping the second part.
So far haven't seen any issues with detection using this method. Still would love to hear if anyone has found otherwise or has other solutions.
I'm not convinced that the example code at https://shopify.dev/apps/online-store/verify-support#verify-support-for-app-blocks is correct. I have been using the second check (which looks for blocks of type '@app') and getting results that do not line up with what I'm seeing in the theme editor. Like, it will report that some templates support app blocks when they don't actually work in the editor, and vice versa.
Yeah I just skipped the second check and things have worked well for me. I wish they would revise their example code for this.
I've been playing with this for the last hour. The code is so bad. Happy I found this thread to know I am not alone lol
I know I'm a little late to the party here but this whole process is appalling to me. This is bound to break in the future. Shopify should have created an API endpoint to do this for us. As soon as any one of those magic strings change (i.e. main- , sections) or the magic [1] index on ${main[1].type}, all of our installs will break.