-
Exporting Episerver content programmatically through an ApiController
As part of the automated transfer of the production database to the testing environment for my current client we found the need to maintain a node in the Episerver page tree that is used for testing. I extended our ApiController with an export endpoint for this purpose. Note that this code is never intended to…
-
Tracing between logs with a correlation ID
Attempting to match timestamps and whatnot to correlate requests over various logs may be quite tedious. Adding a correlation ID to your website makes this easier and may save you quite a bit of time. This is what we did at my current client for all of their Episerver websites. I Implemented this together with…
-
Episerver upgrade: Could not find a part of the path {wwwroot}\ClientResources\ClientResources\packages.config.
Just a short note on an exception I got after upgrading the Episerver NuGet packages on a few of my client’s websites. All of them worked perfectly, except the one that gave me the following message: It is the package.config inside the Shell.zip that it’s looking for. It turns out that the package installation had…
-
Enriching your exceptions with information from Episerver
Adding custom information along with the usual message and stacktrace in your exceptions may possibly make it easier to find out what’s happening in your Episerver website. Here is a bit of code showing how it may be done in a quite simple way. I created it some time back and it has since then…
-
Passing data between your own ContentSecuritySaving and ContentSecuritySaved event handlers in Episerver
If you want to pass information between a PublishingContent handler and a PublishedContent handler (EPiServer.Core.IContentEvents) it is quite easy as the internal code provides you with a Dictionary property on the ContentEventArgs object. This may be useful if you need to maintain information about a property value through an entire publishing process. I.e. find out…
-
Passing custom IContentSerializerSettings to JOS Content Serializer
We use the JOS.ContentSerializer to provide JSON for React in a platform project at my current client (7 Episerver websites spread over 5 installations). For this we needed to provide the JOS.ContentSerializer with custom settings via the IContentSerializerSettings interface to use in our custom property handlers. However, we encountered some difficulties doing this and here…
-
The danger of intersecting Episerver content
Some time ago we had a rather elusive bug on one of my client’s Episerver websites: occationally an item would disappear from a menu, even though no editor involvement had been noted for at least 6 months. My collegue Svante Seleborg found the rather interesting cause of the problem. Intersecting Episerver content We had a…
-
Removing HTML from XHtmlString property values in Episerver
I had to add a character limit to an XHtmlString property in Episerver on a publish event the other day, and knew I had get rid of the markup to get an accurate count. I was pleased to find that the good old TextIndexer was still in there to clean the HTML for me. Here…
-
Adding an index xml-file with GETA SEO Sitemaps for Episerver
Sometimes you need a sitemap index file for easing access to multiple sitemaps. Here is a way of creating one using a custom generator for GETA SEO Sitemaps, described in Multiple custom sitemap.xml generators with GETA SEO Sitemaps for Episerver. The UseGeneratorFor method will expect the index file to be named sitemap.xml, so be sure…
-
Multiple custom sitemap.xml generators with GETA SEO Sitemaps for Episerver
At my current client’s, we’re building a common platform code base supporting 5 Episerver multisite installations. These all have different needs when it comes to xml sitemaps. Here is an easy way of adding custom sitemap generation and have the GETA SEO Sitemap functionality use it. Overriding the generator factory The first thing we need…
-
EPiServer License information: A error occured while loading the license file.
Short note-to-self: if replacing contents of an Episerver license file using variables in Octopus Deploy, make sure the file uses the proper encoding, or you may find yourself facing the following error message: At a client of mine the Episerver license is written to the episerver.license-file using Octopus Deploy. Initially the file only contains the…
-
Simple string encryption for the EPiServer Dynamic Data Store
This is part of the short dynamic data store article series I mentioned before. The layer mentioned may be found in Simple EPiServer Dynamic Data Store (DDS) layer and was mainly created to ease unit testing of DDS code. Since there may be a need to store sensitive information in the DDS I have extended…
-
Simple EPiServer Dynamic Data Store (DDS) layer
This is part of a short article series that have been laying around as drafts for some time, so I figured it was time to actually do something with it. Here is a simple wrapper used for making dynamic data store code a bit easier to unit test. The default implementation of the interface is…
-
Rendering preview blocks with Advanced Reviews while using React for Episerver websites
We are trying out the Advanced CMS add-on Advanced Reviews for one of our Episerver websites at my current client. The thing is that we are also using JOS Content Serializer for turning our Episerver content items into serializable objects in order to feed our React frontend (described in previous articles). This caused issues for…
-
Ajax support for the pluggable EPiServer Find UnifiedSearch implementation
This article is based on work described in A way of consolidating EPiServer Find Unified Search over multiple websites as well as Example: Pluggable EPiServer Find UnifiedSearch for selected types. If you want to use ajax to retrieve more search hits, apply hit filtering or the like, you would need to pay some extra consideration…
-
Example: Pluggable EPiServer Find UnifiedSearch for selected types
In this example on how the pluggable EPiServer Find UnifiedSearch may be implemented we will look at simple type filtering. Previously we did this using TypeSearch, but since we moved to UnifiedSearch in my current project, it had to be reimplemented. For more information, please see the previous article A way of consolidating EPiServer Find…
-
A way of consolidating EPiServer Find Unified Search over multiple websites
At my current client’s we are building a common platform containing shared code between several EPiServer multisite installations. Due to reasons the way we implemented searches with EPiServer Find had diverged to a point where it was necessary to take a step back and refactor it. This is what we came up with. For an…
-
EPiServer Find UnifiedSearch conventions causing ReflectionTypeLoadException to be thrown
At my current client’s we are building a large platform serving several EPiServer multisite installations with common code. Consolidating how we work with EPiServer Find, we ran into a bit of trouble. My collegue Svante Seleborg did all of the heavy lifting on this one (I’m just taking the credit). While attempting to add simple…
-
Fault tolerant file blob provider for EPiServer websites
We have been using EPiServer’s blob storage for saving large chunks of JSON data to disk (please see Storing your own data in EPiServer’s blob store). As these JSON blobs takes a relatively long time to write, chances are the writing is interrupted causing broken JSON blobs. This is especially prone to happen in develop…
-
EPiServer simple address with injected URL slug in multi language website
So you have successfully injected a custom slug at the start of the URL, and gotten it to work in an EPiServer installation with multiple languages. However, now the simple address feature is broken. It only returns 404 Not Found errors. In this article we will continue the example with the injected region slug from…