Month: October 2013
-
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.…
-
Disable the Sitecore admin user
A basic Sitecore 1-0-1 security check is to see if the admin account still uses the standard password. It is commonly seen that sites go into production with the admin / b still working. A way to ensure this does not occur is simply to disable the admin account when building to release or other…
-
Crush png in Sitecore
This post describes a module to crush png in Sitecore which can be downloaded from Sitecore MarketPlace and the latest version of the code is also available free on github. Continuing my fight with Google Page Speed. .NET does not offer an approach for compressing png files other than the default compression. This makes it hard to please…
-
Creating a custom pipeline in Sitecore
Pipelines are one of the most essential parts of Sitecore and creating your own custom pipeline in Sitecore makes your code extremely flexible for both you and others. It is extremely easy to create and run a custom pipeline as this post will show. Defining the pipeline A pipeline consist is a set of processor…
-
Changing a PDF on the fly using Sitecore Media Request
Some time ago I had a fun challenge for a customer. They wanted a legal notice pdf to be appended to all PDF files which was downloaded from specific parts of the media library on the fly. They also wanted to be able to update the legal notice pdf and use a different one for…
-
Preview deletes the .aspxauth cookie
I’ve been working a bit on an extremely weird support case the last couple of days. When the editors on a site clicked on preview from either the content editor or the page editor then the page ended up in a redirect loop. Who stole my cookie? Using Fiddler I quickly noticed that the .ASPXAUTH…
-
Creating a customHandler in Sitecore
Sometimes you would like all requests to a specific path and below to be handled by a specific generic handler. For example in the same manner as the mediaHandler works in Sitecore. Setting up a customHandler in Sitecore Configuring a normal httpHandler in .NET is easy, you simply add entries in the web.config depending on…
-
How to hijack Sitecore instance using only cookie information
Or how to scare any project manager, sales guy or customer into choosing to run their site on https. This is not going to be a lesson in how to obtain cookie information sent over a network. You can find a ton of youtube videos and other resources on how to setup a tool like…
-
Inheriting renderings in Sitecore
A typical page layout contains an aside column beside the main content. These aside columns typically contain spots, boxes or whatever you will call them. We call them spots at Pentia. What is the problem then? When using the page editor for inserting and personalizing renderings then there is a 1 – 1 relation with…
-
Sitecore item languages
This is my fourth post in a series about creating .NET extension methods on a Sitecore item. I love extension methods and have been using them to wrap common operations on Sitecore items since they were introduced in .NET 3. The series of posts will also contain an architectural description on how to implement and…
-
301 URL mappings in Sitecore done easy
When migrating an existing website to a new Sitecore solution the customer typically want to retain their Google Page rank earned by links pointing to their site. To transfer the page ranks of old pages to new ones the response needs a 301 permanent redirect status code and then redirect to a new page which…
-
Does an item have renderings
This is my third post in a series about creating .NET extension methods on a Sitecore item. I love extension methods and have been using them to wrap common operations on Sitecore items since they were introduced in .NET 3. The series of posts will also contain an architectural description on how to implement and…
-
Has references to a Sitecore item
This is my second post in a series about creating .NET extension methods on a Sitecore item. I love extension methods and have been using them to wrap common operations on Sitecore items since they were introduced in .NET 3. The series of posts will also contain an architectural description on how to implement and…
-
Get referrers as Sitecore items through the link database
This is my first post in a series about creating .NET extension methods on a Sitecore item. I love extension methods and have been using them to wrap common operations on Sitecore items since they were introduced in .NET 3. The series of posts will also contain an architectural description on how to implement and…
-
A Sitecore update bummer
When update 6.6 rev 130111 was released I upgraded a customer solution from the previous 6.6 release thinking that this was only a minor update which would solve some of the other issues the previous revision have had. I was terrible wrong and the upgrade led me into a ton of trouble. The first issue in the…
-
Developing Sitecore sites using DMS Personalization rules
As a developer it can be a rough road to start developing with DMS. Where do I start? How do I build a site that is accommodating to DMS? These are tough questions. In this post I will give some simple pointers that should get you started quick and easy on the right path. DMS…
-
A note about Sitecore pipelines
My two previous posts both contained implementations of custom processors for the httpRequestBegin pipeline. Just a quick explanation about their structure and some absolute best practices when implementing your own Sitecore pipeline processors. Check and exit fast Since the httpRequestBegin pipeline handles all requests it is extremely important to check the context for validity before continuing…
-
HTTPS in Sitecore
I would always recommend running all production site cms’ using security on the transport layer (https). Sitecore or no Sitecore, it is not safe to first send username and password unencrypted and then following having an insecure session cookie for the authentication information. This applies for both extranet users and the backend administrators. A basic…
-
Minify html in Sitecore
Pleasing Google Page Speed Minifying resources such as Javascript and CSS is becoming common practice nowadays and something which just should be done with no questions asked. The reason for minification is both to reduce the payload and to reduce the number of requests made by the browser to the server. This makes the page…