How can I limit app block addition to once per page?

Is there a way to limit the number of times a merchant can “(+) Add block” from the app blocks? I’d like the merchant to only be able to add each block once. In the example screenshot below “Gallery” and “List” can be added many times.

I tried limit: 1 on the {% schema %} object but limit is not a valid attribute.

Docs: https://shopify.dev/apps/online-store/theme-app-extensions/getting-started

2 Likes

Good question. Should be good to have a schema entry to limit instance of an app block

like :

blocks-limit : 1

link to current value possible : https://shopify.dev/docs/apps/online-store/theme-app-extensions/extensions-framework#schema

A message should appear when user try to add new block :

You have reach the maximum number of blocks to display(use) for this app.

Could be also a part of a paid plan of the app :

plan1 : display up to 1 block

plan2: display up to 3 blocks

etc

and then the message could be :

You have reach the maximum number of blocks to display(use) for this app. If you want to use more blocks you can upgrade your app plan subscription here.

2 Likes

Hi @wb1 I needed to have the same limit too, do you have any solution on this?

2 Likes

hey @wb1 did you get anything on this? I am also searching for the same.