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 […]
Tips
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 […]
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.
1 2 3 4 5 6 7 8 9 10 11 12 |
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 |
[…]
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.. […]
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 […]
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 […]
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 […]
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 […]
Switch the Context Item
Some times you’ll come across some code which relies on reading the Sitecore.Context.Item and there is no way for you to change this. This can occur when calling some standard Sitecore pipelines, some custom code which has been inherited without the source etc. Well, Sitecore API to the rescue. Introducing the ContextItemSwitcher I am not […]
Sitecore Analytics: Display content by relevance using profile cards
For this post to make sense I will need to create a user story. I will not try to create a standard scenario instead I will create a scenario that is easy to understand and easily applicable to this post. The problem we want to solve is to present some content to the user that […]
Ensuring roles in Sitecore
Roles are easy to create in Sitecore but sometimes you might want to ensure that some specific roles always exists. Not a very common scenario but nonetheless it happens. Once upon a time we needed to be able to ensure that a long list of specific roles always existed on the production instance otherwise some […]
Lucene: Indexing DateTime from Sitecore and querying date ranges
The title should be self explanatory. I need to index some sitecore items that represent some entities that are valid to the public between certain dates. The sitecore fields are date time fields looking like this. I needed a solution for indexing these values in a way that i can do range queries on them. […]
- 2 of 3
- « Previous
- 1
- 2
- 3
- Next »