Creating a Custom Dashboard
A guide to creating a custom dashboard in Umbraco
Last updated
A guide to creating a custom dashboard in Umbraco
Last updated
This guide takes you through the steps to set up a Custom Dashboard in Umbraco.
The steps we will go through in part one are:
A Dashboard is a tab on the right-hand side of a section eg. the Getting Started dashboard in the Content section:
It is generally considered good practice to provide a custom dashboard to welcome your editors to the backoffice of your site. You can provide information about the site and/or provide a helpful gateway to common functionality the editors will use.
This guide will show the basics of creating a custom 'Welcome Message' dashboard. The guide will also show how you can go a little further to provide interaction using Lit and TypeScript.
The finished dashboard will give the editors an overview of which pages and media files they've worked on most recently.
This tutorial uses TypeScript and Lit with Umbraco, It is expected that your package is already set up to use TypeScript and Lit.
To see how to set up an extension in Umbraco using TypeScript and Lit, read the article Creating your first extension.
This tutorial will not go in-depth on how TypeScript and Lit work. To learn about TypeScript and Lit, you can find their documentation below:
There are a lot of parallels with Creating a Property Editor. The tutorial 'Creating a Property Editor Tutorial' is worth a read too.
At the end of this guide, we will have a friendly welcoming dashboard displaying a list of the most recent site logs.
At each step, you will find a dropdown for welcome-dashboard.element.ts
, and umbraco-package.json
to confirm your placement for code snippets.
Follow the Vite Package Setup by creating a new project folder called "welcome-dashboard
" in App_Plugins
.
Create a manifest file named umbraco-package.json
at the root of the welcome-dashboard
folder. Here we define and configure our dashboard.
Add the following code to umbraco-package.json
:
For more information about the umbraco-package.json
file, read the article Package Manifest. For more information about the dashboard configurations read the Dashboards article.
The umbraco-package.json
files are cached by the server. If you are running your site in development mode, the cache is short-lived (~10 seconds). If changes to umbraco-package.json
files are not reflected immediately, try reloading the backoffice a few seconds later.
When running the site in production mode, the cache is long-lived. You can read more about runtime modes in the Runtime Modes article.
Now let's create the web component we need for our property editor. This web component contains all our HTML, CSS, and logic.
Create a file in the src
folder with the name welcome-dashboard.element.ts
In this new file, add the following code:
In the vite.config.ts
file replace the entry
to our newly created .ts
file:
In the welcome-dashboard
folder run npm run build
and then run the project. Then in the content section of the Backoffice you will see our new dashboard:
With all the steps completed, you should have a dashboard welcoming your users to the Backoffice.
In the next part, we will look into how to add localization to the dashboard using our own custom translations.