Project Lifecycle

Using Short IDs

August 30, 2011
Tags: Sitecore

If you've ever worked with Sitecore for any length of time you've worked with an item ID. It's in the form: {7294ECFC-0C37-44AD-B728-ABA259B18889}. There are times when you need to pass the ID around through querystring values or other visible locations but don't want to deal with all the troubles of encoding/decoding the entity characters or just because it's damn ugly. You can, however, convert the ID to just it's alpha-numeric character sequence known in Sitecore as a ShortID. When you convert the previous ID to a ShortID and print the value, the result string will look like this: 7294ECFC0C3744ADB728ABA259B18889. It's still a long value but useful in other ways. The following code sample converts a ShortID string value to an item and then back to a ShortID string.

Transform Web Controls In Sitecore Rich Text Editor

August 25, 2011

This article is a follow-up to an article written previously by John West about embedding web controls in Rich Text Editors.

I spent some good time using web controls in the Rich Text Editor to allow content editors to implement complex functionality inline without a lot of strain. It's a step up from using code snippets where you don't want a content editor to have to switch to html mode to set html attributes or other behind-the-scenes elements.

Add Css Classes to Sitecore Rich Text Editor

August 13, 2011
Tags: Sitecore, Wysiwyg

There are lots of ways to add css classes to sites and I've covered how to setup stylesheets for multi-site installations, but if you're only building a single site on Sitecore and you're looking to quickly populate the class drop down, or any of the other rich text editor settings for that matter, then this is for you.

Sitecore Data Importer

July 08, 2011

Many of the projects I've worked on over the past several years have required importing data either from SQL or from an existing Sitecore installation itself. The original application was a page form that imported data from a database and was developed by Mark Graber, Sitecore MVP and employee at Agency Oasis. Each time I've used it I improve on it and have since retooled it as an internal Sitecore application. I've recently cleaned it up to be a reusable, customizable application and am releasing it as a shared source module. You can find it on Sitecore Shared Source, or by getting the SVN repo at http://svn.sitecore.net/DataImporter. If you want to test it out you'll just need the package install. You'll also want to look over the documentation, which largely reiterates the information in this article.

Fix Broken User Manager

June 01, 2011

I've long given up on using the User Manager paging buttons until yesterday when looking over the known issues, I found an article describing a solution to my problem on SDN. Knowing at least one other individual that has had the same issue I thought I'd do a write up to bring attention to it so that the anyone else with the same issue can get back use of their user manager.  

Partial Html Cache Clearing

May 26, 2011
Tags: Caching, Sitecore

*the code was updated 8/2/2011 with some insight from Mrunal Brahmbhatt. Much appreciated.

 So I recently upgraded my system to Sitecore 6.4 from Sitecore 6.2 and was pumped about a lot of the new features like multi-browser support, new Rich Text Editor but mostly, the new built-in multi-target cache management system. Now I have to say that when I heard the words "partial cache clearing" I completely misunderstood what it meant. I thought it was partial html cache clearing thinking that when a single page got published, just that item was removed from cache. The truth is that when anyone publishes anything all html cache for all sites defined under the web.config's "publish:end" or "publish:end:remote" event are cleared. Sitecore manages a lot more cache than just html cache so by their thinking when just the html cache is cleared, that is just part of all the cache they're working with. In this way they're right, but this strategy is a problem for my particular system because of the large number of sites and editors working on it at any given time. The continually growing number of sites means that I rely on the html cache a lot to minimize the workload on the servers and keep sites loading quickly. I had solved this same issue working with the Stager Module but doing it with this new system is a bit different. Before I go into details about how to do this I will say that I am expecting that you have already setup your system as a mutli-target platform and have properly configured your ScalabilitySettings.config file. If you're looking for more on how to setup a multi-target platform then I'd suggest first starting by reviewing the scaling guide on SDN first which answered all my question about how to get it working.

Update to Sitecore Stager

May 03, 2011

If you're on a Sitecore environment pre-6.3 and you're using the Sitecore Stager you may have noticed that each publish will clear the entire HTML for a site. This may be fine for you but I like to have more granular control over the cache so I've updated the source code a bit to clear only entries related to the published items. I'm not going to knock the Sitecore Stager, it's an excellent utility. Plus this why they release source code in the first place.

Multi Site Rich Text Editor Stylesheet in Sitecore 6.4

April 29, 2011
Tags: Sitecore, Wysiwyg

So while doing a dry run of an upgrade from Sitecore 6.2 to Sitecore 6.4, I noticed something that stopped working in my rich text editor: dynamic stylesheets. I have a large multi-site platform and it's using code from the dynamic stylesheets SDN Article to set a unique stylesheet in the wysiwyg editor for each site. The Telerik codebase has changed a bit and the rich text editor has also. So I'll go through what I did to get it working so you can shortcut the hassle. The first thing you'll need to know is that the file loading the rich text editor is now located at EditorPage.aspx instead of Default.aspx. The class supporting this page (Sitecore.Shell.Controls.RichTextEditor.EditorPage) is also different from it's predecessor (Sitecore.Shell.Controls.RADEditor.RADEditor). I've stubbed out the page directive you'll need to update below:

Sitecore Sublayout Parameters and Datasources

April 27, 2011
Tags: Sitecore

Some of the most useful features in Sitecore are also some of the least well known. The longer you work with anything, the more you begin to understand it. With something as complex as Sitecore you really have to spend a lot of time learning what it can do before you start to really see how well it's suited to solving a lot of different problems.

Site Releases with SVN

April 21, 2011
Tags: SVN, Website

So I've recently spoken to some old colleagues about how they use SVN to release their site code and realized that there is still not a lot of common use of a release process. They suffer due to their time constraints since they've had little time to review and it can be daunting to take on the task of redefining a new aproach to this technology if you're really crunched for time. On the other hand, it can also be very nerve wracking when you're pushing code by updating a folder because if there's an issue a code roll-back is manual. I've been shown a solution to this challenge myself so I thought it would be good to put up an article giving an easy straight forward way for you to upgrade your approach without too much difficulty. If you can't retrofit your project in the way I'll show, you should be able to at least find another way once you understand the principles behind it.