Opti CMS Dynamic Templates

Opti CMS Add-On
C#
GitHub Repository

What It Is

An add-on to create compenentized content templates from the Opti CMS UI

Status

Last Reviewed:

Never implemented. It was talked about a lot, and I did some videos and promotion around the idea, but it was never taken any further than what’s here.

Details

Opti CMS has always been a “high code” system. In particular, templating required development resources. We often had customers that wanted to form their own templates, without having to write any code.

One night, I had a couple beers, and had a crazy idea that was kind of inspired by the AEM Components I had been looking through –

What if a content block didn’t provide content, but instead provided layout and formatting to content that came from the underlying page?

This code allowed editors to create “templates” inside the UI which were collections of blocks. Blocks were things like “Title” and “Image” that, when rendered, just retrieved rendered content from the underlying page (meaning, whatever page they were rendering on).

These templates could be bound to pages in one of these ways (in order on increasing specificity).

  1. By naming convention: You could create a “Template Block” in a designated folder, named for the page type name. This was the most common intended pattern – a lot like having a Razor view for a controller.

  2. By explicit link: Using content reference properties, you could specifically say, “This content uses this template.”

  3. Onboard: You could have a “Template” property on the content object itself.

The system would search in the reverse order the options are listed there, and use the first option it found, which made it pretty flexible – you could have specific templating for specific content objects (#3), a central template for multiple objects (#2), and a final default base on type (#1) if nothing else was specified.

It was a neat idea. But I could never get traction on it at Opti, and then the ground kind of switched out from under us in terms of templating – everything went headless/client-side and this all became less relevant.

I still really loved it. It solved a very common pre-sales issue without doing anything to the core. It was built on top of the CMS, yet didn’t feel like it had any rough edges. It was…elegant. It just kind of fit in beautifully.

There’s a fair amount of doc at the repo URL, and here’s an 11-minute that demonstrates the tool in action.