SaaS CMS has officially launched! Learn more now.

David Harlow
Mar 6, 2018
  3450
(6 votes)

Extending Commerce - Content Area Functionality

By default, content areas in Episerver commerce items such as products and variants don't display the option for creating a new block, and only allows for blocks to be dragged in, as seen below.

Image content-area.PNG

However, an extremely simple solution to change this default behaviour is to inherit from IResourceable on your product/variant which will require the interface member ContentAssetsID to be declared which can simply be scaffolded to false, and this will be all the code required to display the content area as expected! 

    public abstract class SiteProductContent : ProductContent, IResourceable
    {
        [ScaffoldColumn(false)]
        public Guid ContentAssetsID { get; set; }
    }
Mar 06, 2018

Comments

Marcus B
Marcus B Mar 6, 2018 10:17 PM

Great!

Johan Book
Johan Book Mar 6, 2018 11:58 PM

Nice!

Luc Gosso (MVP)
Luc Gosso (MVP) Mar 7, 2018 11:16 AM

thx for sharing! nice!

David Harlow
David Harlow May 3, 2018 12:23 PM

Update: We've decided to remove this functionality from our solution and allow editors to only add shared blocks to content areas on commerce pages, this is due to weird behaviour being viewed such as content completely dissapearing from the content area when not published, hopefully Episerver will fix this in the future. Feel free to vote for this in the following feature request:

https://world.episerver.com/forum/developer-forum/Feature-requests/Thread-Container/2018/5/full-block-support-for-the-commerce-catalog/

Please login to comment.
Latest blogs
Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024