Posts

Adding references to Visual Studio extension project

This might sound like a very simple thing to do, just right click -> "Add References" -> Select an assembly and done. Even easier, just add a NuGet package. Well, not quite. When I added a NuGet package to one of my extension projects I got a runtime error that took me some time to figure out. So I though it might be a good idea to write about it. The package I added was  Extended WPF Toolkit , I like the controls they have. With a package in place I added a WatermarkTextBox control to my XAML like this: <UserControl x:Class="Ext1.ToolWindow1Control" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:xctk="http://schemas.xceed.com/wpf/xa...

Multiple datasource templates for Associated Content dialog

Image
Generally it's a good idea to specify a "Datasource template" for sitecore rendering. It gives your users a great benefit of creating datasource items right from the "Associate content" dialog and also it will allow them to select items of this template only. This works just fine, until you get to a point when your rendering has to accept items of  different types (templates) or even better, you want to be able to create items of different types right from the "Associated content" dialog. Multiple templates for selection Sitecore does not support multiple datasource templates out of the box, there is a blog post by  Gert Gullentops , that helps you fix this. Basically all you need to do is provide your custom pipeline that will parse a list of templates separated by some special character, pipe simbol (|) for example. public class GetMultipleDataSourceTemplates { public void Process(GetRenderingDatasourceArgs args) { Assert.Argumen...