updateinstallationwizard

A quick tip on upgrading Sitecore fast and easy

Today my colleague @alinulms and I had the “fun” task of updating an old Sitecore 6.5 to version 7.2. Actually we really want to upgrade the solution to Sitecore 7.5 but we are still waiting for Sitecore. I really hope 7.5 will be officially released any time real soon. I’ve upgraded Sitecore installations at least a trillion times before (or so it feels) and depending on the version, build environment etc. I’ve used a number of different approaches. The approach we used today was extremely effective so I thought that it deserves a blog post. ...

September 30, 2014 · 6 min · alc
Gzip svg sitecore

How to gzip svg files in ASP.NET

My previous pos t showed how to gzip svg files served by the Sitecore media library. This is fine if all svg files reside in the media library but this is typical not the case. In this post I will show how to gzip compress any svg files served by your ASP.NET solution. As I explained in my previous post the issue that I am attempting to solve is that IIS will not by default gzip svg files without a lot of configuration changes on server level. ...

September 3, 2014 · 2 min · alc
Gzip svg sitecore

How to compress SVG images from the Sitecore media library

This blog post is long overdue. The code was written some time last year when I started my still on-going fight with Google Page Speed. When Sitecore deliver svg files from the media library there is no out-of-the-box approach for gzipping the media content and setting the Content-encoding response header to gzip. Gzipping the svg media content First we need to gzip the media content. To do this we insert the following processor into the end of the getMediaStream pipeline. ...

September 1, 2014 · 3 min · alc
EngagementPlan

Sitecore Analytics rules with custom user properties

This post will show how to create an Engagement plan rule that uses custom fields. The idea is that the users have custom fields on their profile related to newsletter distribution groups. The goal is to create an engagement plan where we have a rule condition saying something like this : The engagement plan using this condition has a user in the initial state, a condition validator and a second state where the user will be put if the condition validates. An email will be sent after the validation (in this case). ...

June 13, 2014 · 3 min · ap
dmssql

Sitecore DMS visits from specific IP addresses

Sitecore DMS stores IP addresses as a varbinary(16) in the Visits table in the analytics database. This is just perfect but it is impossible to read the IP addresses as a normal human being. To help out with this I found the following SQL function which can convert an IPv4 address to a binary. CREATE FUNCTION dbo.fnBinaryIPv4(@ip AS VARCHAR(15)) RETURNS BINARY(4) AS BEGIN DECLARE @bin AS BINARY(4) SELECT @bin = CAST( CAST( PARSENAME( @ip, 4 ) AS INTEGER) AS BINARY(1)) + CAST( CAST( PARSENAME( @ip, 3 ) AS INTEGER) AS BINARY(1)) + CAST( CAST( PARSENAME( @ip, 2 ) AS INTEGER) AS BINARY(1)) + CAST( CAST( PARSENAME( @ip, 1 ) AS INTEGER) AS BINARY(1)) RETURN @bin END So let say that you want to delete all visits from localhost, simply run the following SQL statement using Sql Server Management Studio. ...

March 13, 2014 · 3 min · alc
oie_121156406SOzBwIF

Filter out IP addresses in Sitecore DMS

Today I was asked by a customer to filter out their internal IPs from all DMS reports. There are two approaches for obtaining this. Either very simply add the IP addresses to the Sitecore.Analytics.ExcludeRobots.config as excludedIPAddresses. But I did not like this approach. The customer editors are not robots, so this is messing up domain entities.. Instead I took a different approach and simply wrote a new processor for the startAnalytics pipeline. ...

March 12, 2014 · 3 min · alc
caches

Modifying cache keys in Sitecore

Sitecore ships with some very effective cache mechanisms. One of these mechanisms is the html cache where the output of a rendered control is cached in a table which has a key for each entry. The generated key can vary by different parameters which can be set on the sublayout, xslt, view rendering etc. The vary by possibilities are inherited from the system base template called caching. ...

February 25, 2014 · 4 min · alc

The rather unknown StringUtil class in Sitecore

This is just another quick tip about the Sitecore API and this one has been around forever but I rarely see it used. I use it quite often myself when I perform URL or path manipulations so now I want to spread the knowledge so others can benefit from this helping class as well. It is a class called StringUtil which, as the name implies, contain various methods that does something useful with strings. ...

January 14, 2014 · 3 min · alc

Profiling your Sitecore code using ProfileSection

Just a quick tip for profiling your custom code in Sitecore. Over the years I have seen many different approaches used for measuring and logging the time it takes to execute a block of code. Many of these quite unnecessary since Sitecore already has this functionality built in. Sitecore has a lot of very useful methods for this in the Sitecore.Diagnostics namespace which unfortunately I seldom see used by partners. ...

January 9, 2014 · 2 min · alc

Sitecore 7, Lucene 3.0 and Highlighted results

For all you that will use Lucene 3.0 under Sitecore 7 and want to highlight your results using Luce.Net.Contrib libraries, let me save you a whole lot of time. On Lucene.net page http://lucenenet.apache.org/ you will find a reference to the above mentioned package which i used for retrieving highlighted results from my Lucene index. All nice and smooth until i performed the search and stuck with this error for 3 days: ...

November 29, 2013 · 1 min · ap