Patch delete Sitecore elements based on element content

Recently, I wrote about patching Sitecore instances for specific roles. During my research on how to do this, I was able to use a manner of Sitecore patching I had not previously known about. With a patch:instead, instead of targeting an attribute of the element you can actually target the contents of that element. (Thanks to @jammykam for that Stack Overflow post!)

Why is this useful?

Typically patch:instead is used to replace one value with another in the settings, but because of the matching capabilities of this syntax you can use this to patch:delete elements you couldn’t otherwise match against.

So, when you need to remove an element from the configurations that have multiple elements with no distinguishing characteristics, you can target the inner content instead to distinguish them.

Yummy Config example!

Below is a sample config file which can remove a <using> tag by targeting the text inside the using tag.

<?xml version="1.0"?>
<configuration xmlns:patch="" xmlns:set="">
        <!--Target based on text in the tag-->
        <using patch:instead="using[.='Sitecore.Social.Client.Wizards.AddNetworkAccount']">
          <patch:delete />

Sitecore DevOps: Deploying instance role configurations with solution

Those of you who have installed Sitecore in a scaled environment (i.e. multiple instances) know that the process can be somewhat tedious. To configure an instance to use a specific role, you need to manually enable/disable/modify config files to make the instance act as a delivery, authoring, or processing instance. Oh, do you also want to upgrade to the latest update? Be prepared to have to do it all over again.

While we wait for Sitecore to make this process a little bit easier, I decided that enough was enough and I wasn’t doing those steps anymore. Introducing the Sitecore Role Configs!

Inspired by the work in @kamsar’s SwitchMasterToWeb, the role configs capture the manual steps from those guides in a single role-specific file. Need to configure a processing instance? Drop the processing config file for your version of Sitecore.

Note: Hardening is not covered in these files, so keep that SwitchMasterToWeb handy!

At the time of writing, I’ve got Sitecore 8.0 Update 3 to Update 7 supported and will be working to get other versions in there as time goes by.

One day, I hope that the need for these files will be completely obsolete and I will laugh at how easy it is to deploy new roles of Sitecore. For now, though, happy deployments, and let me know if you find any issues and I’ll fix them up!

Sitecore announces 2016 MVPs

It’s that time of year again: Sitecore has announced the 2016 MVPS! I was again honoured to see my name on the list for the third year in a row. You can see the full list of 2016 MVPs on the Sitecore MVP site.

My outward reaction when reading the email may have been calm and professional, but inside I was more like this:


With a third season on the MVP list ahead of me, I need to find a way to take things to another level. This past year I tackled my goal of having more of a speaking presence and had the chance to do an xDB webinar and also present at the Toronto Sitecore User Group, SUGCON in New Orleans, and at DevOps East in Orlando. I definitely learned things about myself and our great technical community during these trips and I look forward to having a chance to do some more presentations this year.

However, doing a repeat of last year isn’t really stepping things up a level. Instead, I have a few things I’d like to try to achieve this coming year. For one, last year I wasn’t able to create a new marketplace contribution. I was able to provide some updates to the authenticated preview module, but this year I want to actually come up with something new and provide some value.

Also, I’d like to experiment a little bit more with some video content, though maybe not always with a musical slant as was done recently.

Six of my colleagues at nonlinear also received this prestigious award, including the only MVPs in Brazil! If you are interested in reading more, below are some of the releases that Claire and the rest of our team put together. Congratulations team!

Where are the roles in my TDS update package?

Team Development for Sitecore (TDS) supports the ability to manage your Sitecore roles within your TDS projects in Visual Studio. This ensures that important roles defined for things like workflow or other security needs can be deployed to all your environments.

Recently, I was building my packages for deployment to production and was going through the generated .update package and could not find my roles. No folders for roles, no files for roles… WHERE ARE MY ROLES?

Hedgehog support to the rescue!

I reached out to the fine folks at Hedgehog for some help and heard back the same day. Apparently, the standard Sitecore Update package format doesn’t support roles, so when Hedgehog added the support they did some sneaky things to make magic happen. The roles have actually been added into post deployment steps, and you can find the role definitions inside the file /_Dev/DeployedItems.xml.

The XML looks something like this:

<Role Name="sitecore\Keystone Multisite Manager">

This obfuscated CDATA content contains all the things you need to define the role in Sitecore. Pretty nifty!

Sitecore SMTP messages throw “device not ready” error

This was an odd one that came up during a recent project. My colleague Kevin had activated our standard Keystone workflow email notifications and configured the SMTP settings for the Sitecore application.

A short workflow test later and not only were emails not going out but an error was occurring with the message: “The device is not ready”. What is going on? Why is an IO error being thrown?

Continue reading Sitecore SMTP messages throw “device not ready” error

Twelfth day of Christmas… Sitecore memes!

On the twelfth day of Christmas, my true blog gave to me:

Twelve memes of Sitecore,
Eleven lips a-syncing,
Ten WTFs,
Nine giphy’s dancing,
Eight Scrums a-scaling
Seven most-heard retrospective comments,
Six Keystone config tips
Five Golden Rules!
Four CI tools
Three powershell scripts,
Two Keystone merge tips,
…and a placeholder rule in the content tree.


To finish up our countdown to Christmas, here are some great Sitecore memes, mostly provided via Martina’s thread in the Sitecore community forums. Merry Christmas everybody!
Continue reading Twelfth day of Christmas… Sitecore memes!


Get every new post delivered to your Inbox.

Join 65 other followers