SteGriff

Blog

Next & Previous

Trying Sitefinity

I’ve been on some Sitefinity training this week, I’ve only got Umbraco to contrast it with. Here are some thoughts!

Umbraco doesn’t come out of the box with any concepts, whereas Sitefinity has Pages, Comments, Blogs, etc. built in. That could be positive or negative. These features are all ‘Modules’ and you could spend as long switching them all off as you would creating just the DocTypes you need in Umbraco.

SF has a strong emphasis on convention-over-configuration which generally serves it quite well. As long as you know the secret file paths to override something, you can change anything.

Sitefinity custom components can be written with MVC or Webforms but I’m not going to make any further mention of Webforms.

Module Builder

Module builder Module items

Overriding a Dynamic Module’s Detail and List views

When you build a custom module, it will display by default as though it’s some kind of blog post; a list view with title, comments, and publish data, and a detail view. I’m not sure this is so useful but it gets you started.

Firstly, in the widget editor, on ‘List settings’, notice the ‘List template’ dropdown. If there’s more than one option for a renderer, they’ll appear here.

I can override the renderer template in either the Mvc directory or nested under a ResourcePack:

You can also override back office editors and behaviours by writing AngularJS files - just like Umbraco. I won’t go into how it’s done. But it’s funny that both Umbraco and SF rebuilt their backends in AngularJS at the same time… now both have 14 months (at time of writing) until AJS reaches end of LTS!

Pulling Module Items out of the API

The DynamicModuleManager is a little clunky. Your Module Items have whatever custom props you designed, and to query these with a Lambda, SF makes you write the expression as a string(!!) and then presumably it evaluates it with reflection somewhere in the deep.

@{
    DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
    Type questionType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Questions.Question");
    var filteredQuestions = dynamicModuleManager
	    .GetDataItems(questionType)
		.Where(q => q.Visible)
		.Where("InterfaceKey = \"Applicant1DoB\"");
}

Above, Visible is a built-in SF concept, whereas InterfaceKey is a custom prop of my Question object. So you can’t mix these in one Where statement, which is also a pain point.

This feature is really done a lot better in Umbraco, where ModelBuilder re-generates strongly-typed models for each of your Doc Types on rebuild (or app start, depending on config… I think this is called PureLive or something). The upshot is that you can always query your objects like proper objects.

Come to think of it, you can tell from the code Telerik.Sitefinity.DynamicTypes.Model.Questions.Question that SF generates a Type for me… so why can’t they query it with a real lambda?

There’s a Fluent API alternative to the Manager API above, but I’m told it doesn’t quite have feature parity.

Widgets

Widget in toolbox Widget editor

Ordering Module Items

SF has some clever built-in sorting and ordering for your module items. When you add a List to a page, you can specify the items and their ordering. Then, by magic, they are provided to your rendering component in the correct order so that you don’t have to do any sorting in your views. No ‘SortOrder’ property necessary. Sorting and ordering in Umb has always been a little painful, I don’t know if it’s quicker in 8.2+

Sorting items Setting the Sort technique to manual

Variants of Widget Views

I don’t know what to call this feature but it’s fairly neat.

Standard page variant Gold page variant

The Good, the Bad, and the samesies

Some project structure

Good things

Bad things

Same things (as Umbraco 8+)

Remember the cost

All of this needs to be taken in the light that Umbraco is free-as-in-speech. A teenager in the loft can use, extend, modify, and redistribute it for free.

Sitefinity costs exactly “if you have to ask you can’t afford it” pounds. There is no public pricing. The only blog post I found discussed how U of I gets a fabulous grandfathered rate of merely $7000 annually, whereas newly licensing their estate would cost over $100,000. Ouch.

And there’s no great chasm separating their features! They are so similar as to be uncanny at times. So I don’t know really why you’d pay for Sitefinity.

Fundamentally, a non-free technology has zero hobbyist audience because I’m not going to pay to build my personal site on this. So nobody learns to love it.

Make an MVC widget: https://www.progress.com/documentation/sitefinity-cms/112/create-widgets-mvc

Dynamic Modules API (string lambdas): https://www.progress.com/documentation/sitefinity-cms/example-filter-dynamic-content-items-by-dynamic-field

DevMagazine sample site https://github.com/Sitefinity/AdvancedDevCert/tree/master/DevMagazineHtml

Wrap up

Thanks for stopping by! Hopefully this is useful if you’re trying to pick a CMS or get to grips with some Sitefinity concepts from an outside perspective…

Build culture, stay humble 🌿