Søren Kruse | .NET, C# and Azure

  1. Hidden config "include folder" feature in Sitecore

    All Sitecore developers knows about \App_Config\Include - that all *.config files in that folder is merged into the final Sitecore configuration. They also know that they are loaded in alphabetical order and if you want to overwrite something in the default Sitecore configs you have to make sure…

  2. Control access to Sitecore page design per item

    Some time ago a client needed to be able to control access to the page layout on a per item basis. They wanted some users to only be able to change the presentation details in specific parts of the content tree. Sitecore currently isn’t really made to support controlling…

  3. Danish analyzer for Lucene.Net

    I've been looking for a Danish analyzer for Lucene.Net to use with Sitecore ContentSearch. There exists one in the original Java version of Lucene but it hasn't been ported for Lucene.Net yet - the .NET port of Lucene. Actually that's not completely true. The Danish analyzer [seems to…

  4. Environment variables in Sitecore configs

    I just recently found out that Sitecore have been supporting using Windows environment variables in config files since Sitecore 8.2 rev. 160729 (Initial). I was digging around in Sitecore, looking at the ConfigReader for another personal project I was working on, when I noticed these lines: // ... reader.ExpandIncludeFiles(ConfigReader.…

  5. Minor caching bug with Item.Paths.GetPath() in Sitecore 8

    The Item.Paths property returns an ItemPath and with Sitecore 8 they changed the implementation of ItemPath.GetPath(string from, string separator, ItemPathType type) to use caching internally. However the separator is not part of the caching key, only the item it self and the ItemPathType. This of course means…

  6. Get data source items from renderings in a placeholder

    I was recently in a situation where I needed to look at the data source items of all the renderings added to a specific placeholder. Luckily not too long ago I made some extension methods to get the number of renderings in a placeholder, which made the this pretty simple.…

  7. Attribute Routing now works out of the box in Sitecore 8.2

    With the recently released version 8.2 Sitecore has changed how the Sitecore.Services.Client is initialized and it no longer conflicts with Web API Attribute Routing. In fact it is actually already configured for you and you don’t have to do anything (or it will break). NOTE: If…

  8. Unicorn code generation from your Sitecore templates

    If you have ever wanted automatic code generation for your Sitecore templates – with static references to template IDs and field IDs/names, like you can get with TDS and Glass Mapper – then this is one way to get exactly that. Intro Some time ago, at my current company Oxygen, we…