DEV Community

JamieT
JamieT

Posted on

My journey through programmatically creating Umbraco `stuff`

I've been meaning to start sharing my journey through programmatically creating every document type, data type and everything in-between programmatically via Umbraco Package Migrations. The reason for this is so that I can create isolated packages, which when installed create and configures everything needed for this package without any dependencies.

Think of this example, I want to give editors a new 'Carousel' component they can add to the Block Grid. I would create a new Umbraco package, say as an RCL (Razor Class Lib) and include Umbraco Package Migrations, which in turn creates all of the data types, document types and then adds the new document type as an allowed Element of an Umbraco Grid.

Cool right? As this is using Umbraco Package Migrations this also gives us the ability to create new versions of the 'Carousel' package and Umbraco handles everything for us.

I am aiming to share how this journey has gone, how I've tackled certain problems and cool things I find out along the way. With Umbraco 14 and a lot of this stuff being created via JS, this may well need to be rewritten/reworked but for the foreseeable future Umbraco 13 is where it's at and perhaps I'll share how I tackle migrating to Bellissima when the time comes!

Keep an eye out for my first post in this series coming soon.

Top comments (0)