Blog posts by Alf Nilsson2019-05-27T08:00:54.0000000Z/blogs/Alf-Nilsson/Optimizely WorldSupport for Block as Property in the Episerver Content Delivery APIhttp://talk.alfnilsson.se/?p=30472019-05-27T08:00:54.0000000ZSince Episerver 7, CMS has support to add Blocks as Properties. This helps you to group Properties easier as well as reusing code. Unfortunately the Episerver Content Delivery API does not support these blocks. They are simply not serialized into the JSON response. In my example I will use the StartPage from the Alloy Templates […]Support for Block as Property in the Episerver Content Delivery APIhttp://talk.alfnilsson.se/?p=30472019-05-27T06:00:54.0000000ZSince Episerver 7, CMS has support to add Blocks as Properties. This helps you to group Properties easier as well as reusing code. Unfortunately the Episerver Content Delivery API does not support these blocks. They are simply not serialized into the JSON response. In my example I will use the StartPage from the Alloy Templates […]Prevent Episerver ContentDelivery to hijack all application/json requestshttp://talk.alfnilsson.se/?p=30382019-02-26T09:31:29.0000000ZIn one of my projects where we are using the Content Delivery API from Episerver, we also have some custom logic in the templates for some Ajax posting. A JavaScript makes a POST request to the current url and expects a json response, therefore the request has an Accept Header with the value: application/json. Issue […]Getting a previewable property value with UIHint.PreviewableTexthttp://talk.alfnilsson.se/?p=30322018-10-01T16:34:24.0000000ZYou might have seen that the field “Name in URL” first gives you the value and the editor needs to click “change” to edit it. You can also accomplish this on your normal string properties by using the UI Hint “previewabletext” (also found as the constant UIHint.PreviewableText). [Display(Name = "My Property")] [UIHint(UIHint.PreviewableText)] public virtual string […]Adding ImageVault buttons to TinyMCE 2 in Episerverhttp://talk.alfnilsson.se/?p=30282018-07-25T13:09:30.0000000ZWith the new TinyMCE version in Episerver 11, there are some new changes on how to set up your toolbars. Episerver has documented it quite well and how you set it up in the back end is quite similar to how you would set it up using TinyMCE’s JavaScript API. But it took a while […]Tweaking and extending serialization from Episerver Content Delivery APIhttp://talk.alfnilsson.se/?p=30162018-04-24T23:51:55.0000000ZAs you’ve probably heard, Episerver is creating a Headless CMS API called “Content Delivery API“. With this, you can get, list and search (requires Episerver Find) content from Episerver in a JSON format. Matthew Mols has some blog posts about how to get started: Getting started with the Episerver Content Delivery API and Add HTTP Caching to […]Differences between DeletingContent/DeletedContent between emptying trash and deleting contenthttp://talk.alfnilsson.se/?p=30082018-03-21T13:48:00.0000000ZWe stumbled upon an area where the DeletingContent and DeletedContent events slightly differently when you’re deleting content through the IContentRepository, manually emptying the trash and the scheduled job “Automatic Emptying of Trash”. Let’s look at what the DeletingContent and DeletedContent events are. There are multiple articles and blog posts that mention this but simply these […]Automatic visual tests with Episerver: Prepare your conditions with Content Providershttp://talk.alfnilsson.se/?p=29862018-03-12T16:50:11.0000000ZIn my previous post I talked about how to set up automatic visual tests – and for a time, it was good. Then editors and other team members starts changing the content and your tests starts showing deviations based on content changes rather than code changes. Yes, you can set up rules on not changing […]Workaround that ImageVault.EPiServer.UI 5.5.36 does not support non-standard portshttp://talk.alfnilsson.se/?p=29812017-12-07T23:11:56.0000000ZWe have upgraded the NuGet package ImageVault.EPiServer.UI to 5.5.36. This package is used to install ImageVault properties and editor UI into Episerver. However I noticed that I was unable to add images to the ImageReference properties in Episerver. The “Insert” button was replaced with “Publish”. Looking into the javascript errors I found the following: imagevault-insert-media.min.js:1 […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=2981&subd=toders&ref=&feed=1" width="1" height="1" />Automatic visual tests with Episerver: Test after a Deployhttp://talk.alfnilsson.se/?p=29712017-12-03T23:01:33.0000000ZA common reason I have heard that Episerver developers don’t write automatic tests are that they’re “only doing content websites”. First of all I suggest that you have an “API first” approach, even if you’re only going to make content based functionality such as listing and filtering News Entries. This falls well into the classic […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=2971&subd=toders&ref=&feed=1" width="1" height="1" />Simple pattern for custom formshttp://talk.alfnilsson.se/?p=25162017-07-10T11:28:51.0000000ZThrough the years I can’t really keep count on how many custom forms I have created. I have found a simple pattern so that I can easily collect, validate and save the submitted information using a Model, Validator and Saver (MVS?). Dos and don’ts I want to show you some practices I consider as Don’t and […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=2516&subd=toders&ref=&feed=1" width="1" height="1" />Presenting: Find My Contenthttp://talk.alfnilsson.se/?p=21432017-02-12T18:06:28.0000000ZMy main project is a multi website solution where 16 different websites is sharing the same source code. Sometimes when we need to change specific Content Type and find a strategy on how to migrate the changes it’s good to know how much that Content Type is used, and in what way. How do you […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=2143&subd=toders&ref=&feed=1" width="1" height="1" />Episerver Event Helper v3.0http://talk.alfnilsson.se/?p=18852017-01-11T22:35:18.0000000ZYears pass and hopefully you learn something and become better! One thing that have been poking on my conscience for a while is the old EPiEventHelper that I blogged about a couple of years ago. What’s wrong with it? There are two things I don’t like with it. 1) Unclear usage I have seen that it […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1885&subd=toders&ref=&feed=1" width="1" height="1" />Removing all translations – Part I (understanding the Episerver Database)http://talk.alfnilsson.se/?p=18702016-07-06T16:20:06.0000000ZMe and some colleagues had a project where we needed to remove all translations from an Episerver website except one. For that we needed to know what the database structure looks like in Episerver and I will share this to all of you! Now I’m trying out something new – a video post! I know it’s not the […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1870&subd=toders&ref=&feed=1" width="1" height="1" />Planning your Episerver projecthttp://talk.alfnilsson.se/?p=14472016-06-17T16:33:44.0000000ZYou’re going to start working on a brand new Episerver project! Your solution is a brand new slate where you can add your best code ever and you just received the design specs and requirements! Now you need to sit down and get an idea how to build your solution. But where should you start? In […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1447&subd=toders&ref=&feed=1" width="1" height="1" />How to NOT use properties on Content Typeshttp://talk.alfnilsson.se/?p=13602016-05-17T14:08:20.0000000ZI’ve seen more and more examples on how to NOT use properties on your Content Types – setting visit/Request specific information to them. My example below is a very harmless, but I’ve seen examples where the price for an e-com site is set like this! How do you mean? The example would be to display […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1360&subd=toders&ref=&feed=1" width="1" height="1" />Where to integrate with Episerver Formshttp://talk.alfnilsson.se/?p=11972016-05-07T16:47:36.0000000ZIf you want to control what’s going on when a form created with Episerver Forms is submited, there are different areas you can implement your logic. The most usable ones (or the ones most people would go for) would be Controllers where the submitted form is posted, the implementation of DataSubmissionService, various Events and through Actors. So […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1197&subd=toders&ref=&feed=1" width="1" height="1" />Episerver Forms: How to change where uploaded files are storedhttp://talk.alfnilsson.se/?p=13232016-05-06T23:57:03.0000000ZDuring my session about Episerver Forms at the Øresund Episerver Developer meetup I received a question about how to change where uploaded files are stored A quick look at how Episerver Forms manage the posted information I found that it is the DataSubmissionService that creates an Asset Folder and stores the file. By replacing the original DataSubmissionService with a […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1323&subd=toders&ref=&feed=1" width="1" height="1" />Change access rights for Episerver Find UIhttp://talk.alfnilsson.se/?p=10702016-05-05T19:59:03.0000000ZAs you probably know, Episerver Find has a UI where the editors can see statistics on how their visitors use the search functionality, fine-tune their search results by adding best-bets, related queries, synonyms and boost results as well as get an overview what kind of information is indexed in the Find Index. To see the menu items […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=1070&subd=toders&ref=&feed=1" width="1" height="1" />Customize “Suggested Page/Block types” when creating contenthttp://talk.alfnilsson.se/?p=9612016-04-17T19:32:31.0000000ZI’ve found a neat way to improve the editor experience – IContentTypeAdvisor and it can be found in the EPiServer.Cms.Shell.UI.Rest namespace of the assembly EPiServer.Cms.Shell.UI.dll. This interface is used to populate the list of suggested Content Types when creating new content. This interface has one method GetSuggestions which returns an collection of ids of block […]<img alt="" border="0" src="https://pixel.wp.com/b.gif?host=talk.alfnilsson.se&blog=18285343&post=961&subd=toders&ref=&feed=1" width="1" height="1" />