Contentstack allows you to create dashboard widgets for your stack’s dashboard.
To create a dashboard widget, log in to your Contentstack account, and perform the following steps:
- Go to your stack, navigate to the “Settings” gear icon, and select Extensions.
- On the Extensions page, click on the + Add Extension button, and select Create new. If you have not added any extensions in the stack yet, click on the create a new one link as shown below.
- In the Select Extension Type window, select Dashboard Widget.
- In the Create New Extension page,enter values in the fields as given below:
- Title: Provide a suitable title for your custom dashboard widget. This title will be visible as a widget name on the main dashboard page.
- Default width: Choose the width of the custom dashboard widget. Select either Half Width or Full Width as per your requirement.
Tip: The height is configurable through the Extensions SDK. You can also define if the user can toggle between Half Width and Full Width in the SDK.
- Hosting method: Select how you want to host the widget:
- External Hosting: Select this option for externally hosted widgets. You need to provide the URL in the External hosting URL field that appears below.
- Hosted on Contentstack: Select this option if you can write the code in the Extension source code field that appears below.
- Config Parameter: If you have used any config parameters (such as access token) in the source code, specify the value of the parameters in this field.
- Enable dashboard widget: Check this option to make the Dashboard Widget enabled for all users of the stack on the main Dashboard page.
Tip: Using the “Settings” gear icon on the Dashboard page, the users can show or hide the widget on their Dashboard.
- Finally, click on Save.
Here are the links to the API requests related to this action: