Sitecore

Rollback Sitecore Pipeline Processors

Sitecore Pipelines are an easy and powerful way to execute encapsulated actions in a pipeline. But what missing is, that you can’t execute processors in a transaction: Once executed, the action can’t be reverted. To add this functionality to your code, you could implement the Reversible Command Pattern. In most cases, the functionality of the Sitecore Pipelines are enough for the requirements. But there are cases where they don’t. An example is a contact form, which executes the following action…

Keep reading »

Shared field references in Glass Mapper

This is a repost from our german written Sitecore Vibes blog. It covers the topic to load referenced items without checking for a valid language version for a specific field. This was initially one of my questions on Stack Overflow where Mike Edwards, developer of Glass Mapper, answers my question and helped me also with continuous problems, thanks again! Our projects often have some configuration values which we configure with Sitecore items. For all these configurations (which are shared, so…

Keep reading »

Correctly switching Sitecore contextes

In the last couple of weeks I came across multiple posts on Stack Overflow and the SDN forum, where someone needs to switch a specific Sitecore context property for some reason. Let’s take the : we need to change the language, do some actions (i.e. loading some items in this language) and change the language back to the one before. I saw, that most of the users do this fully manual: Buffer the current language in a variable Set the new language with Do whatever needs to be done Reset the…

Keep reading »

Absolute urls for internal links with Glass Mapper

We recently decided to include an ORM in our next Sitecore project. It should be Glass Mapper. The key feature of the ORM would be, that we can map all our Sitecore items and their data to strongly-typed objects in C#, automatically. One of the first features I had to implement was a Web Api which should return the Url (internal or external) of a General Link field of an item. This url should of course be absolute, so the client system can make use of the url. My first thoughts were to add some…

Keep reading »

Provoke 404 for inexistent language version

Most of our customers have their websites organized in multiple country sites with multiple languages. If we say we have one site which should be available in German and English, then each page should be translated in both languages. In fact, there are always pages/items which are not available in both languages, or are not yet translated for some reasons. What if the user requests an item in German which is only available English? Exactly, the user should see a 404 (page not found) error…

Keep reading »