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

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-link-query-parameters)

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… :call_me_hand:

3 Likes

Still searching for this answer if anyone has any insights :grinning_face_with_smiling_eyes: .

Has anyone found the solution to this one??