Skip to content
Menu
Search
Browse documentation & this page

Developer Guide

Getting started

Create the CMS host, sign in and publish your first page.

Cendia is a .NET CMS you add to an ASP.NET Core app, not a platform you deploy and then build inside. Your site is the host; the CMS is a package it references.

Create a site

Already have an application? Follow Add Cendia to an existing app instead of generating a starter.

You need the .NET 10 SDK and SQL Server or LocalDB. Cendia comes from its own NuGet feed, https://nuget.cendia.com/index.json, with no key or sign-in. The first command below installs the starter template from it; the site it makes names the same feed, so its packages restore from there and each new release shows up as an update in Manage NuGet Packages.

For a complete implementation walkthrough, choose Build with Razor or Build headless.

dotnet new install Cendia.Templates --add-source https://nuget.cendia.com/index.json
dotnet new cendia-starter -n MySite
cd MySite
dotnet run

cendia-starter is the only template, and it is the release object — the supported starting point a release delivers. It is deliberately minimal: one page type, its template, and a content zone. Bare means nothing you have to delete, not nothing that works.

The first run

Cendia's migrations ship in its packages, and in Development on a database on your machine the site applies them as it starts, so the first dotnet run creates the schema against the connection string in appsettings.json. Pointed at a database on another server it does not; run Update-Database instead. See Database changes. On a fresh database /cms leads to the setup wizard, which is where the first account is made.

Your own data goes in a DbContext of your own, with a table prefix of your own: cms_ is Cendia's.

/ has nothing to render until you publish something. Publish a page from /cms, and / renders it through the template paired with its type.

What the host actually wires up

Three calls, all in Program.cs:

builder.Services.AddDbContext<CmsDbContext>(options =>
    options.UseSqlServer(connectionString));

builder.Services.AddCendia(o =>
    builder.Configuration.GetSection("Cendia").Bind(o));

// ...

app.MapCendia();

AddCendia registers the services and the authoring surface. MapCendia maps the CMS UI at /cms, the delivery and preview APIs, /sitemap.xml, and — when rendering is enabled — the catch-all that turns a page tree into URLs.

Call UseRouting, UseAuthentication, UseAuthorization and static files before it. MapCendia registers a little middleware of its own, because some of it has to sit at an exact point relative to the routes it maps, and that is an ordering a host should not have to know about or be able to get wrong.

Rendering is a switch

Cendia:EnableRendering decides whether this installation serves pages at all. With it off, / redirects to /cms and the CMS is a headless content API. With it on, / is the site's start page and the editor is still at /cms — it just stops being what the bare hostname answers with.

A headless installation is a supported shape, not a half-configured one.

Where to go next

Content types are C# classes; the editor is built from them. That is the next page, and it is the part of Cendia most worth understanding before you write anything.