How to extend placeholders in Sitecore MVC

Wow it has been ages since I last wrote a blog post so it is about time that I get started again. A colleague of mine asked me a question the other day about how I would implement a page(experience)-editable accordion spot where each element in the accordion is a rendering item. Kind of like shown below where the content in each accordion element is a rendering with its own datasource. You should be able to personalize and test each rendering individually. ...

September 24, 2015 · 5 min · alc

Working with custom MongoDB collections in Sitecore 8 using WebApi

The introduction of the xDB to the Sitecore eXperience Platform offer a ton of new options for us Sitecore developers. As a bonus we suddenly have a data store for anything at any time instead of either trying to make the data fit into Sitecore items or give up and go with a custom database. Now we can just use mongo for almost anything. In this post I will show how extremely simple it is to get and set data in a custom mongo collection. ...

January 24, 2015 · 3 min · alc

Implementing a WebApi service using ServicesApiController in Sitecore 8

This will just be a quick post about implementing a WebApi controller in Sitecore 8 using the ServicesApiController class. Perhaps this post can help some of the teams in the ongoing Sitecore Hackathon, who knows. The ServicesApiController class Sitecore.Services introduce a new abstract class called ServicesApiController that derives from the System.Web.ApiController. The class itself only purpose is to identify an ApiController as being a Sitecore ServicesApiController. This identification is used by some WebApi filters that is added in the include config file Sitecore.Services.client.config ...

January 24, 2015 · 4 min · alc

Securing the password recovery experience in Sitecore 8

Following my post on password recovery in Sitecore 8 fellow Sitecore MVP Kam Figy pointed out how the default Sitecore implementation potentially can be used by a malicious individual to block an editor from logging in by resetting their password automatically. This can be done simply by creating a script that request a new password for a known user name once every x minute/second. That would really annoy the victim and potentially also cause business havoc. ...

January 23, 2015 · 5 min · alc

The amazing password recovery experience in Sitecore 8

Along with the new login screen in Sitecore 8 there is also a new implementation of password recovery for editors. In the old versions of Sitecore the /sitecore/login/default.aspx page redirected the user to a page called passwordrecovery.aspx. This page used an asp:PasswordRecovery asp.net standard webcontrol. Personally I never became fond of all of these standard but rather complex asp.net webcontrols back when they were released with .NET 2.0. They allowed you to really quickly get a demo site up and running with standard functionality but changing any behavior just a tiny bit to fit your domain specific needs or even design took much more effort than just to use simple webcontrols to build up the same functionality. I only know about most of these webcontrols due to old Microsoft certifications where you were forced to answer all questions like you used them all the time even though you always chose not to because of their inflexible design. ...

January 21, 2015 · 6 min · alc
queryableextensions

Generic extension methods for Sitecore ContentSearch

I would first like to mention that the code shown in this post is not originally mine. I’ve been using it quite often lately and made some tweaks to it which is why I think it deserves a quick blog post. Some of the code originate from my colleague Uli Weltersbach, he wrote a blog post on how to index base templates in Sitecore. The rest of the code I got from my colleague Bo Breiting. He wrote this blog post about his extension methods for Sitecore ContentSearch. ...

November 6, 2014 · 4 min · alc
custom_caches_in_Sitecore

How to create a custom cache in Sitecore

When coding a Sitecore solution you sometimes need a cache to store some values. I’ve seen a lot of different cache implementations in Sitecore solutions that do not use the Sitecore API. Such an implementation could for example use a static or perhaps a singleton some even go further and use a custom database or a nosql document database such as RavenDB or Mongo. It is very rare that these implementations could not simply be replaced by using the built-in Sitecore caching API. ...

October 26, 2014 · 4 min · alc
mailserver

Sending emails in Sitecore

Sometimes you need to send an email from your Sitecore code. I’ve seen a ton of solution implementations where the developer have written some custom class that sends out emails using a SMTP client, good old classic ASP.NET. I myself even wrote code for that in Sitecore solutions some years ago. That was before I noticed the very simple method on the Sitecore.MainUtil class called SendMail. The SendMail does exactly what you expect it to do. ...

October 26, 2014 · 2 min · alc
wildcardparser

Matching Wildcards in Sitecore

While reading this nice blog post by my colleague Uli about resolving a Sitecore SiteContext from an URI I noticed that he used a regex to match a hostname using * as a wildcard That made me remember the Sitecore class called Sitecore.Text.WildcardParser. I once wrote a blog post about this class but I never got around to publish it. So now I’ll try again and keep it short. The WildcardParser class is pretty unknown even though it is an oldie in the Sitecore API. It can be used to match a string value with an array of strings where a * means wildcard. It is used by Sitecore to check if a SiteInfo class matches a hostname. An example usage of the class could look like this: ...

October 26, 2014 · 1 min · alc
richtext_field

Customizing Sitecore rich text field configuration

People often ask me questions on how to configure the Sitecore rich text editor in various ways. The Sitecore rich text editor is really easy to control and customize and there are already a lot of blog posts about it out there. Most of these posts only show how to create custom editor profiles and not how to override the actual editor configuration. I guess everyone knows how to create custom rich text editor profiles by now so this is not what I want to show. If this is what your are looking for then just ask google. ...

October 23, 2014 · 5 min · alc