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

ArtemFokin
Shopify Partner
9 0 0

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
Shopify Staff
2731 297 768

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
9 0 0

Hello, thanks
We will wait when you add this feature