Blocks Code Snippets

Here are some useful short code snippets that you can use in any type of Blocks app. Copy, adapt the names to your app and make things work!

Get Pricing Plan

Get the pricing plan of an app instance on a specific site. For example, “free” or “premium”. Learn more

Copy

Get widget properties in a panel

Use a custom panel to get the widget API properties.

Copy

Learn more about connecting panel elements to properties:

Set widget properties in a panel

Use a custom panel to set the widget API properties.

Copy

Learn more about connecting panel elements to properties:

Open a dashboard page from a panel

Create a link in a custom panel that opens the app dashboard page.

Copy

Learn more about opening a dashboard page from a panel:

Create a link in a custom panel that opens the app’s plan picker.

Copy

Learn more about:

Access inner-widget properties from a panel

Get and set properties of a nested widget from a panel in the outer widget. Learn more

Copy

Expand and collapse panel elements

Expand and collapse elements in a custom panel. Learn more

Copy

Query data from a CMS database collection

Use wix-data to query collections in your app.

Copy

Learn more about managing collections in Blocks:

Did this help?