What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Reference to another block(get block ID) from theme customization page

Reference to another block(get block ID) from theme customization page

ArtemFokin
Shopify Partner
18 0 3

Hi
We are working on theme extension which should know about other blocks on the page. It would be much easier for merchants and us to have some block ID or get reference to another block on the page on the customization page. Like every block on the page has unique ID, can you just display somewhere near block title, so merchant will be able to copy it and paste in our app.

Replies 2 (2)

Liam
Community Manager
3108 344 895

Hi Artem,

While there isn't a feature to directly display block IDs in the customization page, you can get the block IDs from the theme's JSON file. However, we appreciate your feedback and will take it into account for future updates. 

 

For now, you can guide your merchants to get the block IDs from the theme's JSON file. Here is an example of how you might locate a block ID:

{
 "sections": {
  "5ac3e115-be8f-4426-a09c-4397a1672899": {
   "type": "newsletter"
  }
 },
 "order": [
  "5ac3e115-be8f-4426-a09c-4397a1672899"
 ]
}

In this example, 5ac3e115-be8f-4426-a09c-4397a1672899 is the block ID.

 

Hope this helps!

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

ArtemFokin
Shopify Partner
18 0 3

Hello, thanks
We will wait when you add this feature