• Is a penguin a bird? – Using embeddings in Open AI to categorize words
    In this post I am going to answer the question “Is a penguin a bird” using Open AIs embedding endpoint. I will touch upon topics from both philosophy and computer science. However, I will try to keep everything practical so that this blog post will be for everyone interested in Open AI and ChatGPT.
  • Building a GPT-3.5/GPT-4 compatible BPE tokenizer in .NET 4.8 framework
    In this post I will present a GPT-3.5/GPT-4 compatible BPE tokenizer I have written for the .NET 4.8 framework. I am going to explain how the GPT models perform tokenization and how we can mimic the tokenization process locally.
  • Generate context-aware suggestions in Sitecore using ChatGPT
    In this post I will present some changes I have made to my SitecoreSuggest integration between Sitecore XM and Open AI. These changes will allow the generation of “context-aware” suggestions within Sitecore using ChatGPT (like keywords based on existing content). I am also going to explain how tokenization is done by the GPT models.
  • Integrating Sitecore with Generative AI and ChatGPT
    In this blog post I will present an sample integration between the Open AI GPT generative language models and Sitecore XM. This integration will allow content editors to generate content directly from Sitecore using an array of language models including ChatGPT.
  • Caching complete pages in Sitecore XM
    This blog post showcases a proof-of-concept I did yesterday: The code is simply a sketch but it shows how we can get access to the final rendered Sitecore page via a response filter and cache the result.
  • Moving template fields with standard values in Sitecore XM
    When moving fields from one template to another, the standard values are not automatically moved to the destination template. In some cases this makes sense, but if you need to refactor a lot of template, this event handler will allow you to move template fields together with their standard values.
  • OpenID and OAuth 2.0 with Sitecore Identity Server
    I recently held a talk about OpenID and OAuth 2.0 using the Sitecore Identity Server as an example. In this post I have rewritten my notes and will provide a quick and practical guide to Sitecore Identity Server.
  • Sitecore Partner Connect Copenhagen
    Today I have spend most of the day at the annual Sitecore Partner Connect in Copenhagen. The day was filled with a lot of interesting talks aimed at Sitecore Partners and customers. In this post I will try to distil the day into a number of key topics.
  • Using rules and synonyms in Sitecore Search
    In this post I will look into how rules and synonyms can be used to customize search results in Sitecore Search and provide more relevant search experiences.
  • Integrating Sitecore XM with Sitecore Search using the Ingestion API
    In this post I will show how we can use the Sitecore Search Ingestion API to actively push content into Sitecore Search and integrate this with Sitecore XM publishing as an alternative to web crawling (e.g. for pages behind login).
  • Setting up a Web Crawler in Sitecore Search
    I recently got access to a Sitecore Search sandbox and one of the first things I tried out was setting up a Web Crawler. In this post I will outline the steps I took and provide a quick overview of the Sitecore Search service.
  • Video: Using the Sitecore Authoring and Management API to create a custom Sitecore job viewer
    In this video I will show how I used the Sitecore Authoring and Management API to get a list of running job from a Sitecore 10.3 XM server and create a custom Sitecore job viewer. The custom job viewer is a standalone WinForm application available on my Github.
  • Using the Sitecore Authoring and Management API to create a custom Sitecore job viewer
    In this post I will show how I used the Sitecore Authoring and Management API to get a list of running job from a Sitecore 10.3 XM server and create a custom Sitecore job viewer. My custom job viewer is a standalone WinForm application available on my Github.
  • Enabling and authorizing requests to the Authoring and Management API in Sitecore
    With Sitecore 10.3 comes the Sitecore Authoring and Management Graph API. The API provides a single endpoint that allows you to manage Sitecore content using GraphQL. The endpoint is disabled by default, but in this blog post I will show how we can enable the endpoint and get the required access token to start calling it.
  • Video: Custom webhook events in Sitecore XM and XM Cloud
    In my last video, I looked at the Webhooks Event Handlers introduced in Sitecore 10.3 and XM Cloud. In this post I will show how we can define our own events and use these together with out-of-the box webhook functionality with a customized payload.
  • Video: Using Webhooks in Sitecore XM and XM Cloud
    With Sitecore 10.3 came the possibility to use Webhook Event Handlers to call external APIs when a Sitecore event is triggered. The feature is available in both XM and XM Cloud and offers an easy and no-code way of integrating with external systems via HTTP POST requests.
  • Custom webhook events in Sitecore XM and XM Cloud
    In my last blog post, I looked at the Webhooks Event Handlers introduced in Sitecore 10.3 and XM Cloud. In this post I will show how we can define our own events and use these together with out-of-the box webhook functionality with a customized payload.
  • Using Webhooks in Sitecore XM and XM Cloud
    With Sitecore 10.3 came the possibility to use Webhook Event Handlers to call external APIs when a Sitecore event is triggered. The feature is available in both XM and XM Cloud and offers an easy and no-code way of integrating with external systems via HTTP POST requests.
  • Avoiding server errors when generating thumbnails in Sitecore
    We routinely monitor the logs of the websites we work on, and in the post I am going to describe one issue I recently located and fixed in a Sitecore 10.3 XM solution. The issue generated bursts of 500 server errors in the logs when a content editor accessed the Media Library via the Sitecore… Read more: Avoiding server errors when generating thumbnails in Sitecore
  • Problems with using Multi-Line Text fields for HTML in Sitecore
    In this post I will describe a bug we fixed in Sitecore 10.3 yesterday. The bug affects the Experience Editor and prevent certain combinations for HTML tags (<link>, <a>, <img> and <image>) from being saved correctly in a Multi-Line Text field. To understand the bug, lets first look at the module where this bug appeared:… Read more: Problems with using Multi-Line Text fields for HTML in Sitecore
  • Copying content between databases in Sitecore
    In this post I will describe some of the methods we have for copying items between databases in Sitecore. We can use these methods when content has been corrupted or is missing in one database but can be salvaged from another. If you are reading this post, you are probably in some extraordinary situation, so… Read more: Copying content between databases in Sitecore
  • Scheduled publishing in Sitecore
    I recently helped a colleague implement a lightweight scheduled publishing functionality in Sitecore 10.2. The solution allows content editors to schedule the publishing and unpublishing of content using the existing publishing restrictions and is lightweight in terms of code and impact on the overall solution. In a standard Sitecore installation, publishing of content is a… Read more: Scheduled publishing in Sitecore
  • Sitecore wildcard items
    In Sitecore, we have the option to use “wildcard” items to capture multiple URLs with a single piece of content. The goal of this blog post is to provide an overview of how this out-of-the-box wildcard resolving works in regard to URLs, paths, queries and when using Sitecore Content Search. The post is based on… Read more: Sitecore wildcard items
  • Exploring Sitecore Jobs
    As a Sitecore developer you are likely familiar with Sitecore Jobs. Sitecore Jobs is a great way for starting and monitoring long-running tasks on a Sitecore webserver. In this post I will explore some ideas I have been exploring with regards to extending Sitecore Jobs a bit. It revolves around two topics – firstly, making… Read more: Exploring Sitecore Jobs
  • Implementing an internal Sitecore interface
    I recently worked with a colleague on implementing support for SearchStax’s Disaster Recovery feature on Sitecore 10.2. While the implementation is not the topic of this post, we faced a peculiar problem when applying it: We needed to implement an internal Sitecore interface. This post will describe how this can be done. Implementing an internal… Read more: Implementing an internal Sitecore interface
  • Debugging a Sitecore solution
    In this post I am going to describe an approach for identifying and removing bugs from a Sitecore solution. This approach is broad and heuristic in nature, mostly based on personal experiences. If you wish to dive further into the methodologies used in debugging, a good starting point is the Wikipedia article on debugging (https://en.wikipedia.org/wiki/Debugging).… Read more: Debugging a Sitecore solution
  • The Experience Editor in headless Sitecore using Next.js: API Routes Response Size Limited to 4MB
    I am currently working on a headless Sitecore solution using Next.js and Experience Edge. In this post I am going to explain one particular fix we had to do, to avoid sending excessive amounts of data to the rendering engine when using the Experience Editor causing the /api/editing/render to fail. Sitecore’s Experience Editor allows a… Read more: The Experience Editor in headless Sitecore using Next.js: API Routes Response Size Limited to 4MB
  • Token replacement in Sitecore using GlassMapper
    In this post I will show how token replacement in Sitecore can be implemented using using GlassMapper. The idea is that instead of e.g. entering a office phonenumber on multiple pages, a token like phonenumber is used.
  • Sitecore field data corruption
    When we develop solutions based on Sitecore, we create custom code as well as Sitecore content. The code is stored in a version control system like Git, whereas the Sitecore contents exists inside a number of Sitecore SQL databases. Sometimes it makes sense to make some of the Sitecore content “part” of the code, especially… Read more: Sitecore field data corruption
  • Setting up Rainbow SFS for Unicorn in Sitecore
    When multiple developers work on the same Sitecore solution, it is necessary to have mechanisms for sharing an evolving solution across a number of local installations. For the code files, mature version control system like Git efficiently track changes and synchronize these between computers. Conflicts between changes are handled by tested-and-proven workflows known and understood by… Read more: Setting up Rainbow SFS for Unicorn in Sitecore
  • Generic interface co- and contravariance in C#
    In this post, I will explore generic interface co- and contravariance in C# introduced in 4.0. which allow us to control how the inheritance of generic parameters affect the inheritance of their generic type itself.
  • Faceted search in WordPress
    About a month ago I talked to a friend of mine about WordPress and PHP. Being a staunch .NET loyalist he quickly concluded that he had no time for sloppy PHP. PHP supports both procedural and object-oriented paradigms and WordPress is a prime example of why this is not always a good idea: The WordPress… Read more: Faceted search in WordPress
  • Echo server
    This spring, I follow a course in mobile and distributed systems at the IT University of Copenhagen. During the course, I am going to post some of my homework to this blog. The course is part of the The Master of Science in Software Development and Technology programme, and focuses on distributed programming, concurrency, Web… Read more: Echo server
  • WCF exception handling
    I recently read a old post on http://www.techinterviews.com containing interview questions for C# developers. One questions goes: ”Why is it a bad idea to throw your own exceptions?” And the answer is “Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error… Read more: WCF exception handling
  • Microsoft Team Foundation Server: Moving from Visual Source Safe
    As a developer at Magnetix A/S, I am currently spearheading the implemention of Microsoft Team Foundation Server (TFS) across the organization. This include moving most of our codebase from our old Visual Source Safe, setting up custom project templates and describing best practices and workflows. The process have not been without problems, but my general… Read more: Microsoft Team Foundation Server: Moving from Visual Source Safe
  • Modifiers
    Modifiers in C# are keywords added to class and field declarations (and in some cases enums, interfaces and structs as well). C# supports a wide range of modifiers, and in this post, I will go through some of the advanced modifiers and explaining how they can be used. The concept of modifiers is in itself not that… Read more: Modifiers
  • Using generic methods and constraints
    Generic methods are a powerful way to provide type safety yet creating flexible methods that support multiple types. The idea behind a generic metode is simple: A generic method accept parameters and returns values of a range of different types. Hence it is generic, opposite to specific. But there is a little more to the story.
  • Formatting enums using CustomFormatters
    C# enums are named constants, making code easier to write and read. But the enum names should not be written to the UI. This post shows two methods of formatting an enum to a string suitable for the UI. A C# enum is simply a named constant: Let’s say you are working on a application where you need to… Read more: Formatting enums using CustomFormatters
  • First experience with Sitecore 6
    I just started a new project, my first one in Sitecore 6. Sitecore have improved 5.3 in a number of ways. The installation was not without its problem. The installer complained about a missing ASPNET user, although the user was clearly present. Hence I ignored the warning, and continued. After installing the files, I tried… Read more: First experience with Sitecore 6
  • Overflow, checked and unchecked
    The CLR supports both unchecked and checked integer arithmetics. This post explains how this is exposed in the C# language.
  • Shared classes and Web Services
    The Windows Communication Foundation Services have simplified the way you use classes in distributed application.
  • Paths in User Controls
    This post is about the different way to write paths in User Control, and about the special ASP.NET Web Application root operator.
  • Method signatures
    With a few simple tricks, you can avoid those annoying changes in the method signatures in your application.
  • Dynamic Compilation in a Web Application
    With a simple trick, you can mimic the dynamic complilation of a Web Site in a Web Application. Visual Studio 2008 comes with the Web Application project type build-in. As you may know, the main difference between a Web Application and a Web Site is that a Web Application must be compiled, whereas a Web… Read more: Dynamic Compilation in a Web Application
  • Strings the right way
    In this post, I will show how you can optimize your string operations by using the StingBuilder class and the static class String. I’ve done it tons of times: Concating string the wrong way. Concatenation is the process of joining strings. And if I have a string s1 = “Hello”, and I want to append… Read more: Strings the right way
  • Rotation around an vector in C#/XNA
    This post show how you can rotate one vector around a arbitrary axis, represented by a second vector. This is done by defining a rotation matrix. I was playing around with the Microsoft XNA framework, and needed a way to rotate a vector around a second vector. Now I know that the framework probably include… Read more: Rotation around an vector in C#/XNA