With our .NET Core migration out of the way we've been busy evaluating feedback, fixing bugs and working on some new and exciting features. Today I'm pleased to announce the release of Cofoundry 0.3, which is now available on NuGet.

Here's some of the feature highlights:

Nested Data Models

The big feature this release is the ability to define data models that can be nested inside other models. This is useful for creating rich data structures for your block types and custom entities, and enables the creation of more complex components such as multi-layered menus, advanced carousels and other nested content scenarios.

Nested data models are defined in code by composing simple c# model classes. For example, we can create a carousel block type data model by defining the following two classes:


using System.ComponentModel.DataAnnotations;
using Cofoundry.Domain;

public class CarouselDataModel : IPageBlockTypeDataModel, IPageBlockTypeDisplayModel
{
    [MaxLength(100)]
    [Required]
    public string Title { get; set; }

    [Required]
    [NestedDataModelCollection(IsOrderable = true, MinItems = 2, MaxItems = 6)]
    public ICollection Slides { get; set; }
}

public class CarouselSlideDataModel : INestedDataModel
{
    [PreviewImage]
    [Image]
    public int ImageId { get; set; }
    
    [PreviewTitle]
    [Required]
    [MaxLength(100)]
    public string Title { get; set; }

    [PreviewDescription]
    [Required]
    [MultiLineText]
    [MaxLength(200)]
    public string Summary { get; set; }
}

Cofoundry then uses these models to dynamically construct an editor interface in the admin panel without your having to write a single line of javascript.

I'm going to blog in more detail about this feature next week once we've finished updating our samples. For now if you want to get started with nested data models you can check out the documentation.

[Updated] The nested data models blog post is now up.

New video plugins

While working on some issues with our YouTube and Vimeo editor controls we decided that the potential scope of these features was too big for the core CMS and that they would be better placed in a plugin.

You can now find these features in the Cofoundry.Plugins.YouTube and Cofoundry.Plugins.Vimeo plugins.

We've also improved the YouTube plugin so that you can optionally provide an API key and bring back additional data such as the video title and description as well as validating the video exists. For Vimeo this functionality is still available without an API key.

YouTube video editing in the Cofoundry CMS admin panel

Running without an imaging plugin

One area that has caused some confusion is that imaging is not built into the core Cofoundry package. This is because the ASP.NET Core framework does not have a built-in image manipulation library suitable for running on a web server, and we instead rely on plugin packages to provide image file verification and resizing features.

We've now clarified this in the installation docs, but we've also provided better error handling in the admin panel so that if you get an exception while running in the development environment, the developer exception page is shown in a popup modal.

So if you run the site in your development environment and try to upload an image without installing an imaging plugin you'll see this a handy popup with all the exception details and a link to the relevant documentation for extra clarity.

Development error handling experience in the Cofoundry CMS admin panel

When running in any other environment a simple user-friendly error modal appears.

Feedback

Thank you to everyone who's been trying out Cofoundry and providing us feedback. It's been great to hear your experiences and we'll continue to push forward with new features over the coming months so please keep the feedback coming and we'll endeavor to prioritize popular issues and features.

Links