EPiServer Content Delivery Api only returns 404 NotFound

Lately I spent some time investigating 404 NotFound responses from an EPiServer Content Delivery Api installation. While the SiteDefinition Api URL worked just fine, the problem was that the API returned 404 NotFound for all contents requested. Here are some pointers to determine possible reasons. Thanks to Svante Seleborg for helping out with debugging. EDIT: Matthew Mols have written an useful article for Getting started …

React and EPiServer: Removing properties from output in EPiServer.ContentDeliveryApi

If you read my previous article React and EPiServer: Aggregated output with EPiServer.ContentDeliveryApi you saw a way of including your own aggregated data through properties in the content model classes. Since the JOS Content Serializer also has a very useful ignore attribute, ContentSerializerIgnoreAttribute, I’d love the EPiServer Content Delivery Api to have one as well. Removing superfluous properties from EPiServer ContentDeliveryApi output Since the EPiServer …

React and EPiServer: Aggregated output with EPiServer.ContentDeliveryApi

If you read my previous article on React and EPiServer: Moving to EPiServer Headless (EPiServer.ContentDeliveryApi) with friendly URLs – Quick POC, you’ll know I wanted to output EPiServer Content information by friendly URL to a page rather than using the headless API’s own paths. This I did, but what about aggreagated information? You know, the stuff that are using for instance content from other EPiServer …

React and EPiServer: Moving to EPiServer Headless (EPiServer.ContentDeliveryApi) with friendly URLs – Quick POC

So EPiServer released a beta version of the ContentDeliveryApi. Nice. My current client uses the JOS Content Serializer for creating JSON data from EPiServer pages for view, preview and on-page-editing with React, as described in previous articles. However, sooner or later it will be neccessary to start using EPiServer’s own methods for this. I had a quick look at the API functionality, and it seems …

EPiServer’s ServiceLocator will not prevent you from doing proper unit testing

I often hear people saying things like “Don’t use the ServiceLocator, you can’t write unit tests with it”, or “EPiServer‘s ServiceLocator will really cause problems in your unit tests”. It really will not though, and it’s quite easy to set up. Simple base class for unit testing with EPiServer’s ServiceLocator Quite often the argument is that the ServiceLocator’s container and your mocking framework’s container are …

React and EPiServer – Generic pass-through property handler for JOS ContentSerializer

In a previous article I wrote about React and EPiServer – Custom rendering of EPiServer block in XhtmlString field without partial block controller, as we’re using the JOS Content Serializer to make JSON of our EPiServer content. This is in order to pass it to React. We were using the version 2.0.1, and it differs a bit on how things are done now (currently latest …

EPiServer TinyMCE 3 Wrapping selection in unsupported aside tag

For my current client, we had a need to allow EPiServer editors to wrap XHtmlSting field content in aside tags in a user friendly manner. The first most obvious thought went to the styles drop down list and EPiServer’s editor.css file, however after a few tries and a bit of Ilspy‘ing I realized that the aside tag element is not supported by the current implementation. …

React and EPiServer – Getting friendly URLs in EPiServer’s XHtml fields using JOS.ContentSerializer for React support

So just a follow up on the previous article React and EPiServer – Custom rendering of EPiServer block in XhtmlString field without partial block controller in regards to friendly URLs. We noticed that all our internal EPiServer links in the XHtml field properties remained on the internal form ~/link/{guid}.aspx, even in the view mode. The reason for this was really quite obvious since we had …

Blank page in Umbraco site after installing Vega IT’s uSiteBuilder

I ran into some trouble after installing Vega IT‘s uSitebuilder NuGet package on my newly created Umbraco website. The whole site suddenly went blank, and all I could get from the network traffic was a 500-error without body. Nothing was being written to the logs either. I’ve seen blank pages before, and sometimes they’re caused by broken configuration files, so after examining my web.config file …

React and EPiServer – Custom rendering of EPiServer block in XhtmlString field without partial block controller

For my current client we’re building a component based platform as a common feature hub for serveral large EPiServer websites. For this, we have stripped away the default Razor based rendering that is normally used for the view and edit modes, and replaced it with React all the way through. Having React render blocks through ContentArea properties for the view and on-page-edit modes may not …

EnvInject plugin variables not getting injected from properties file in Jenkins build step

Today I had a bit of a struggle with the Jenkins EnvInject Plugin while trying to inject custom variables from a properties file into my MSBuild step. Everything that I added to the Properties Content field was successfully injected, and looking at the log, the EnvInject reported successfully injecting my file envVars.properties variables as well. I used PowerShell to retrieve the current Git branch and …

EPiServer Forms: JavaScript error – cannot read property ‘validate’ of undefined

I saw this JavaScript error earlier this week, and thought I’d write a few lines about it. It appears as you try to submit a form created with the EPiServer Forms functionality, that likely has custom validators on some of it’s fields. As EPiServer Forms tries to run it’s client side validation on the fields it gets presented with one requiring a custom validator; which …

EPiServer Forms: Adding custom client side validation to form field (Luhn algorithm)

When you’re developing custom EPiServer Forms field blocks you sometimes need to add your own custom validation as well. In this article you’ll see an example of how to add client side validation for the Luhn algorithm in a custom textfield block. This article assumes that you already have server side validation on your EPiServer Forms field; covered in article EPiServer Forms: Adding custom server …

EPiServer Forms: Adding custom server side validation to form fields (Luhn algorithm)

When you’re adding custom EPiServer Forms field blocks to your solution, you occasionally have the need for adding custom validation as well. Here is a sample of how to add a custom server side validation to your textfield block; you will probably also need client side validation for this, please see the article EPiServer Forms: Adding custom client side validation to form field (Luhn algorithm). …

EPiServer Forms: Forcing a field block to use a certain validator

There may arise situations where your custom EPiServer Forms field blocks make no sense without your custom validation code being applied as the website visitor submits the form. In these cases it may be useful to help the web editor by preventing the need to tick the correct validation checkbox in the form element block. Creds to my collegue Christer Bermar for his work on …

EPiServer Forms: Moving your EPiSever Forms views to another location

By default, EPiServer Form views goes in the directory /Views/Shared/ElementBlocks/, however if you’d like them placed elsewhere, this is easily done by adding a simple service configuration and extending EPiServer’s CustomViewLocationBase making an addition to it’s Paths array; see below. MyCustomViewLocationBase.cs Above code will allow you to keep views in a Forms directory in the Views/Shared folder.

NullReferenceException in EPiServer EPiResourcesController causing edit mode load to fail

In one of my current projects EPiServer‘s edit mode suddenly stopped working. Only the top bar loaded, while the rest failed due to a JavaScript error (see image below). NetworkError: 500 Internal Server Error caused by GetResourcesDictionary throwing NullReferenceException To investigate, we tried surfing to the failing JavaScript resource (http://{host}/EPiServer/Shell/10.7.1.0/ClientResources/EPi/shell/ui/nls/en-us/contenttypes.js) only to discover that the 500 Internal Server Error was caused by a NullReferenceException. Stack …