Creating your First Integration
Creating your first integration with Umbraco UI Builder.
In this guide, you will find the necessary steps needed for a basic implementation using Umbraco UI Builder to manage a single custom database table.
Setting Up the Database
Out of the box, Umbraco UI Builder works using PetaPoco as the persistence layer, as this is what ships with Umbraco. If you prefer, it is possible to use a custom Repository. However, for getting started, it is expected that you are using this default strategy.
In this section, let's create a Person
table to store data. Run the following script in SQL Server Management Studio (SSMS) to create the Person
table.
This script creates a table for storing people’s details. You might want to populate it with some dummy data for testing.
Setting Up the Model
With the database table set up, create the associated Poco model in the project.
To create a Model:
Create a new folder called Models in your project.
Create a new class file called
Person.cs
.Add the following code:
Configure Umbraco UI Builder
With the database and model set up, it is time to configure Umbraco UI Builder to work with the Person
model. This will allow you to manage Person
entities from the Umbraco backoffice.
Open the
Program.cs
file in your project.Locate the
CreateUmbracoBuilder()
method.Add
AddUIBuilder
beforeAddComposers()
.
For this guide, the following configuration is used:
Accessing the Umbraco Backoffice
After defining the configuration, compile and run your project. To access the newly defined section, you need to give permission to the backoffice user account:
Login to the Umbraco backoffice.
Go to the Users section.
Navigate to the user group you wish to assign the newly defined section.
Submit the changes.
Refresh the browser to view the new section.
If you click on a person's name, you will see the following screen:
Summary
This setup allows you to extend and customize your Umbraco site by managing data and entities directly in the backoffice. The simplicity of the implementation allows to create dynamic, user-friendly interfaces for your own data models.
Last updated
Was this helpful?