Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How can I find a theme's template ID programmatically (for deep linking into an existing app block?)

How can I find a theme's template ID programmatically (for deep linking into an existing app block?)

agrohs
Shopify Partner
14 0 8

Hey Shopify app devs... hoping to get some help on an issue I'm working on, specifically related to deep linking from my app into the theme editor.  It appears that the deep linking functionality is only for “adding” an App Block to a theme. (https://shopify.dev/docs/apps/online-store/theme-app-extensions/extensions-framework#app-block-deep-...)

The use case I am looking into is related to deep linking into an “existing” App Block.  In looking at the URL structure when I am inside of my theme, is see the following pattern:

https://admin.shopify.com/store/[SUBDOMAIN]/themes/[THEME_ID]/editor?previewPath=/pages/contact&block=template--[TEMPLATE_ID]__[SECTION_ID]/[BLOCK_ID]&section=template--[TEMPLATE_ID]__[SECTION_ID]

Using the themes.json and assets.json APIs, I am able to retrieve all of the above information EXCEPT for the TEMPLATE_ID.  I can’t seem to figure out how to fetch this value dynamically.

Does anyone know how/where I can find this programmatically?

Any ideas or suggestions would be appreciated... 🤙

 

Particular.
the innovation agency of tomorrow, today
Replies 2 (2)

agrohs
Shopify Partner
14 0 8

Still searching for this answer if anyone has any insights 😄.

Particular.
the innovation agency of tomorrow, today

addons_appliv
Shopify Partner
1 0 0

Has anyone found the solution to this one??