How to get Pages in to Commerce
Episerver Commerce was built with a fundamental goal of connecting Commerce and Marketing. Commerce leverages some of the key concepts of working with content from the successful Episerver CMS 7 platform. I was, with that statement in mind, quite surprised to find out, that Commerce, out-of-the-box, didn’t allow my authors to use Pages inside the Catalogue interface. Intent was to utilize the powerful features for structuring (e.g. use a partial rendering of a page) and associating content across both Episerver CMS and Episerver Commerce. Luckily, I found a simple solution.
How to use Pages as Content in Episerver Commerce
Solution is pretty self explanatory if you are familiar with how it is possible to register Components (Widgets) for Episervers authoring interfaces. All it requires is a single class.
Above class tells Episerver to register a Widget based on epi-cms.component.MainNavigationComponent in a designated place known as /episerver/commerce/assets/defaultgroup. If you instead wan’t the widget to appear next to the Catalogue structure, in the left hand side, then you can adjust the registration slightly.
Be aware that the Component registering the existing Catalogue structure uses 50 as SortIndex. Adjusting your SortIndex to go below 50 will impact which Widget is shown by default when the Catalogue interface is opened.
I told you. It was easy.