Add migration step with sql script

Scenario: Wanted to add a new schema, table and stored procedure to the same database where CMS is installed. The script should run only once after deployment to an environment. Using IMigrationSet can do this job, although is different from a Initialization Module that run every time the site starts up. Interface IMigrationStep documentation: https://world.episerver.com/csclasslibraries/commerce/EPiServer.Commerce.Internal.Migration.Steps.IMigrationStep?version=13Continue reading “Add migration step with sql script”

Download images from assets from HTML Anchor tag

Suppose the front-end code wants supply a way to download images from the assets folder. Consider the following code: Assuming that 127.0.0.1:5500 is your EPiServer instance, you can say that the image will be downloaded. Note that download anchor attribute will work if the url is from the same origin of the http request. ForContinue reading “Download images from assets from HTML Anchor tag”

Missing Group on Set Access Rights

Context: Episerver authentication integrated with Azure Active Directory B2C; A fresh installation of Episerver; Virtual roles configured to map Roles configured on AD; Logged only with an account that was mapped for a AD role named ‘SpecialMegaRole’ 😉 Another virtual role was mapped for an AD role named ‘NotSoSpecialRole’ Objective : Set the access rightsContinue reading “Missing Group on Set Access Rights”

Add Metafields to OrderSummary view

I need to add extra information on each LineItem of the order. But also to see it on the OrderSummary view on the Commerce UI. Please comment if i can implement a better solution than following approach, because i thought that it could be a fast solution by changing the xml file were we defineContinue reading “Add Metafields to OrderSummary view”

The view ‘index’ or its master was not found or no view engine supports the searched locations. From IISExpress to IIS

Consider the following scenario: Developing with debug compilation and using IIS Express. Everything works fine without license. Episerver allows development under those circumstances. But if you deploy to a new IIS site or even to Azure web app and you set compilation without debug, because you probably published with Release configuration: The site will showContinue reading “The view ‘index’ or its master was not found or no view engine supports the searched locations. From IISExpress to IIS”

Start from empty folder to a running Episerver CMS and ECommerce

Assumptions: this post was written at 23/10/2019 with Visual Studio 2019 and Episerver CMS Visual Studio Extension version 11.5.0.412. The idea is to create a running empty site with CMS and ECommerce. Ensure that you have Episerer nuget feed configure to https://nuget.episerver.com/feed/packages.svc/ Lets create a new empty Episerver CMS site: With this we start toContinue reading “Start from empty folder to a running Episerver CMS and ECommerce”

Setting icons for content types

When creating new types instances, such as pages or blocks, we get a lot of help from the CMS UI identifying which type we want. But, to offer better experience to the editors, it would be much nice that these types could be present with an image. Episerver recomend 120×90 dimention for each icon, butContinue reading “Setting icons for content types”

Sharing properties between content types, and action methods between controllers

It is a good idea to provide derived types from the Episerver content types PageData, BlockData and MediaData to share common properties among all the pages on the site. We should also consider to use that also on the controllers. Considering the class diagram: We can start to implement the Base[Classes] and Standard and StartContinue reading “Sharing properties between content types, and action methods between controllers”