initpipeline

Global.asax events and Sitecore pipelines

At Pentia we always try not to change any files that ships in an out-of-the-box Sitecore installation. This makes upgrading easier and the solution code more transparent for developers. Sitecore ships with a standard Global.asax file and a lot of Sitecore developers choose to make changes directly in this to hook into application and session level events. For example see the tutorial code from Glass Sitecore Mapper here the Global.asax is used to set the glass context on the Application_Start event. ...

October 12, 2014 · 2 min · alc
awesomechat

SignalR component for SPEAK in Sitecore 7.1

Following my blog post from earlier this week where I showed how to make SignalR work in Sitecore SPEAK, I thought of another solution to the same issue which is much more streamlined with SPEAK. The issue which I hacked my way through was that the RequireJS implementation in SPEAK requires that a JavaScript file ends with .js if it does not then .js will be added automatically. ...

February 3, 2014 · 6 min · alc

Making sense of Sitecore SPEAK pipelines

Following this great post by my colleague Alan I came up with an idea on how to improve the SPEAK pipelines concept. The main problem with the pipelines as they are in Sitecore 7.1 is that there is no way to add or remove processors without making changes in JavaScript code. You can’t even change the order in which they are added without changing their priority in code (see Alan’s blog post). ...

January 30, 2014 · 7 min · alc

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 of our code and an integration to an external system could fail. Inspired by the EnsureAnonymousUsers processor in the initialize pipeline I made the following small module. It is very similar to the code I shown in my previous post on how to disable the admin user. ...

October 30, 2013 · 2 min · alc
crunchpng

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 google page speed automatically since one of their checks is if the images on a site are losslessly compressed. ...

October 26, 2013 · 6 min · alc

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 classes which each has a method called Process which takes one argument of PipelineArgs or a derived class. ...

October 25, 2013 · 1 min · alc

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 the rendering reference that is inserted and the item. Inserting aside spots on each and every page is extremely time consuming for editors and might also exceed their Sitecore knowledge if they’re not trained. ...

October 15, 2013 · 5 min · alc

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 content some what corresponds to the content found on the old url. A simple example ...

October 14, 2013 · 4 min · alc

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 processing. If a simple check fails then exit the processor right away. Example public class MyCustomProcessor { public void Process(PipelineArgs args) { if (!IsContextValidForProcessor()) return; DoSomeOperation(); } } This rule applies for all pipeline processors, if the context is not valid for the operation exit immediately and let the rest of the pipeline continue on. ...

October 13, 2013 · 2 min · alc

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 best practice is simply to ensure that all requests containing authentication information such as the .ASPXAUTH cookie used by ASP.NET, only gets transferred using the https scheme. ...

October 13, 2013 · 4 min · alc