Blocks for EPiServer Commerce Catalog Nodes

Can we use Blocks with Catalog nodes? In theory Yes, what can stop you. We had a requirement when CMS editor can add a Carousel Block to Catalog Nodes. But Block Gadget was not available in CMS Catalog Edit Mode. Only available gadgets were Catalog, Media, Latest and Versions. From architecture point of view I was convinced that we can add ContentArea for Catalog Nodes and Blocks can be reused for Catalog Nodes also. I googled the issue and find an answer by Linus. Its simple I want to keep solution as a self note.

Add the following section under your <episerver.shell> section in web.config and the blocks gadget should appear for the commerce view (given that you have not customized your view):<viewManager>
<views>
<add name=”/episerver/commerce/catalog”>
<settings>
<add name=”AddSharedBlocks” transformationType=”Add”
definitionName=”EPiServer.Cms.Shell.UI.Components.SharedBlocksComponent”
plugInArea=”/episerver/commerce/assets/defaultgroup” />
</settings>
</add>
</views>
</viewManager>
Media Data:
[CatalogContentType(GUID = “#”, MetaClassName = “DigitalNode”, DisplayName = “Digital Catalog Node”)]
    [AvailableContentTypes(Include = new Type[] { typeof(BookProduct), typeof(BookVariant) })]
    public class DigitalNode : NodeContent
    {
        /// <summary>
        /// Gets or sets the content area for the category.
        /// </summary>
        [Display(
            Name = “Content Area”,
            Description = “Content area to hold cms contents for category like carousels”,
            GroupName = SystemTabNames.Content)]
        [CultureSpecific]
        [Editable(true)]
        public virtual ContentArea MainContentArea { get; set; }
}
Episerver.dll version was 7.5.394.2 (I am not sure yet it has been fixed or added in next versions or not)

3 replies on “Blocks for EPiServer Commerce Catalog Nodes”

  1. Great! I guess there is still missing the "For this Catalog/Product/Variant" folder in the block structure? If it is not missing, that would be awsome 🙂

    Br,
    Andreas Clair

  2. If this doesn't help, navigate to My settings -> Display Options and click "Reset Views" button. EPiServer saves some gadget display preferences into Big table and they were overriding changes we had made to the config.

    Best regards,
    Dasha Finch

Comments are closed.