Fixing DDS mapping issue

Time to time I am getting an issue with DDS mapping mismatch. In this article, I will show the possible solutions.

Market routing in Episerver Commerce

The most of the Episerver Commerce project examples (for example, Quicksilver) are using cookies to store selected market. The URL doesn't change which can cause several SEO issues. Crawlers are not able to index market specific content. If the market info could be included in the URL, it would solve most of these problems.

Automating Episerver website configuration

When you have multiple environments - for production, staging, and testing, there is a need to copy over production environment data to staging and testing environments. In Episerver this is quite easy - just copy over database and blobs. But you have to update Episerver website configuration to match your staging/test environment setup. You have to change website URL and add hostnames for your new environment. This can be done in a user interface, but it is better to automate.

Episerver commerce content version preview

Episerver has preview functionality available in edit mode. It did not satisfy our customer. The customer wanted to see the page as it will be displayed when get published. But I found that Episerver has "hidden" feature which enables you to display concrete commerce content version.

Changing static resource URLs to CDN URLs with URL Rewrite

Recently I was configuring a CDN in Azure for one of our projects. We needed to serve most of the static content (images and scripts) from the CDN to improve page load times. After the CDN had been set up, I had to change the content URLs to point to the CDN. There are several options to do it. You might handle it directly in the code, rewrite all URLs in some handler or as I did with URL rewrite.

NuGet package creation with FAKE

Recently, I was creating a library package for Episerver and required to create a NuGet package. Usually, at Geta we have a Team City configuration for project builds and NuGet package creation. But this time I was creating my package. While it is possible just to package your project with nuget.exe directly, it would need too many manual steps when releasing a new version of your package. In this article, I will show how to use FAKE for this purpose.

Manual order discount

Last week I had a requirement to implement a manual order discount which can be set on any cart by the administrator/editor. I found that there is a manual discount for line items in the Commerce Manager and found how to use those in my code. When I tried to implement it the same way for the order discount, then it didn't work. The order discount requires a different approach which is described in this article.

UI testing basics in Episerver

I haven't done UI testing much as I found it quite unreliable, hardly maintainable and hard to write. But there are still some cases when it is useful to have some UI tests.

Configuring Razor view support for Episerver modules

I have not created an Episerver module before. When I started on one last week, I found that there are no examples with Razor views. After looking and trying to create a module, concluded that it even doesn't support Razor views by default. But I figured out one way which works.

Testing events

Previously, I wrote an article how to handle events in the Episerver but I did not show how to test those. I am a fan of the Test Driven Development but when working with the Episerver it is quite hard to test the code including .NET event testing. Developers tend to not write unit tests for those. In this article, I will show that this is quite easy when using the right tools.

How to save (not publish) catalog content properly

Usually, when importing or updating categories, products or variations I have published those immediately and never had any issues. But recently had an issue when a customer wanted to publish updated products manually. I had to save those without publishing but didn't get anything saved - at least no info was visible in the UI.

Better event handling in Episerver

In January I wrote an article which documented Episerver content events. As it was seen from this article, there are plenty of events available and those have different event arguments with different properties where not all of those properties are used. This makes the API hard to use.

Razor view engine for feature folders

There are some resources available which explain how to configure razor view engine to support feature folders. But most of these resources describe how to do it in an ordinary MVC project. Episerver projects have some limitations which I took into account in this article. This article also covers a sub-folder support.

A feature's sub-tech folders vs sub-feature folders

Almost a year ago I wrote an article about feature folders vs tech folders. I explained why you should favor feature folders vs tech folders. While I see this style of architecture more and more, I also see that developers use tech folders inside feature folders. In this article, I am going to describe alternatives to this type of structure.

Episerver Content Events Explained

There are times when you need to be notified about some actions happening in the Episerver and execute the code when it happens. Episerver has built-in events which help to achieve it. In this article, I will describe content events which are implemented through IContentEvents interface.

Episerver Dependency Injection status

Episerver just released a new version which added a constructor injection support in scheduled jobs. It encouraged me to create a list of different Episerver infrastructure parts which still do not support a constructor injection.