This is the CodeArt blog. This is where we share everything from tips & tricks to thoughtleadership articles or interesting code samples.
If you are looking for older blog posts published by Allan Thraen (Like those from labs.episerver.com or Allantech.com) you might be able to find them in our Archive.
When best practice isn't the best - Dependency Injection and Optimizely CMS
Some people live and breath 'best practice' development. I am not one of them. Risk is, in-experienced developers (or sometimes experienced) might use them just cause they are 'best practice' and not think more about it. Even when it turns out they are not. Here is little example...
Automatically have Optimizely Content created in the correct place
A classic problem is that you want better structure and governance in for example your blocks. Maybe you have a policy to have all Banners or FAQ items in a specific folder so they can easily be found and re-used across the site, but way too often editors take the 'easy' approach and use the "Create a New Block" option in a content area - which by default places the block in the "For this page" folder, rendering re-use impossible. Here is a simple solution to that.
AI Assisted Content Creation - in Optimizely CMS & Commerce (AI Series - Part 2)
AI assisted content creation is an exciting new approach driven by algorithms and models like GPT-3, DALL-E, Stable Diffusion and more. At CodeArt we've been experimenting how to use these technologies to enhance the editorial process. In this second part of the blog series on the topic I'll share a video of a prototype integration to Optimizely (Episerver) CMS of content creation using AI for both images and text.
Self service with Fluid Templating for editors in Optimizely CMS
A classic need in many websites - especially self-service sites - is a placeholder mechanism, so editors can use placeholders in their text to be replaced with user specific data. Recently, working with a client, we ran into this problem and tried out a new approach to empower the content creators to solve this themselves.
Anti-Pattern: Don't modify Optimizely CMS (Episerver) content objects in the Controller
Using your content object (CurrentPage / CurrentBlock) as a makeshift viewmodel where you change settings or extend it with user data in the controller before passing it to the view, is unfortunately (and to my surprise) a pretty wide-spread practice among developers implementing Optimizely (Episerver) web sites. But it really needs to stop.
Optimizely (Episerver): Split folder structure for blocks and media
Since version 7 or 8 of Episerver (now Optimizely CMS), the shared Blocks and Media have been sharing the same folder structure. Some people see a benefit with the shared structure, and some absolutely hate it. Personally, I have gotten used to it - but I was recently asked if it's possible to split it up. Here's the hack I came up with.