Project Templates

Last Updated: 2018-10-18

If you want to get started quickly the easiest way to get going is to use one of the Templates for Piranha. The templates are used to create a new project from scratch and not to add CMS functionality to an existing application.

If you want to add Piranha into an application, it's still a good start to create a new project from one of the templates and examine what happens in the Startup.cs.

Basic Web Template

How To Install

Project Templates for .NET Core are installed from the CLI using the dotnet new command. It's always good to include which version you wish to install as this will also allow you to update an existing template to a newer version.

> dotnet new -i Piranha.BasicWeb.CSharp::5.2.2

How To Use

When creating a new project with dotnet new you should first create a new empty folder. The default behaviour is that the new project is named after its containing folder.

> dotnet new piranha
> dotnet restore
> dotnet run

What's Included

The Basic Web Template includes models, controllers and views for the:

  • Startpage with a Hero, Teaser Section and Block based content.
  • Blog Archive with a Hero and Post listing.
  • Basic Page with Block based content.
  • Basic Post with a Primary Image and Block based content.

Blog Template

How To Install

> dotnet new -i Piranha.Blog.CSharp::5.2.1

How To Use

When creating a new project with dotnet new you should first create a new empty folder. The default behaviour is that the new project is named after its containing folder.

> dotnet new piranha.blog
> dotnet restore
> dotnet run

What's Included

The Blog Template includes models, controllers and views for:

  • Blog Archive with paging, category & tag filtering.
  • Blog Post with a Primary Image, Ingress & Block based content.
  • Basic Page with Block based content.