SaaS CMS has officially launched! Learn more now.

Scott Reed
Apr 6, 2018
  1368
(3 votes)

Enabling the Page Tree Component in the Commerce View

When it comes to building an interconnecting website that has both CMS and Commerce you end up with a lot of different pages and blocks. Within this setup you end up having pages that are PageData based and within the site tree as well as commerce nodes, product and variations that also act a pages.

If like us at Redweb designed your blocks and pages for maximum drag and drop support you may come across an issue when creating blocks with drag and drop support and link back to CMS pages when using within commerce. This is due to the fact the site tree is not shown in commerce.

In our case we also have our global configuration stored in the site tree ourside of the site context and needed to be able to drag these configurations in to blocks/pages expecting these types.

Our simplte solution was to re-enable the site view within the commerce context with the following

[Component]
    public class CustomPageTreeComponent : PageTreeComponent
    {
        public CustomPageTreeComponent()
        {
            PlugInAreas = new[]
            {
                "/episerver/cms/mainnavigation/defaultgroup",
                "/episerver/commerce/mainnavigation/defaultgroup"
            };
        }
    }

This will then add another tab to the commerce view for pages enabling full drag and drop support when in the context of commerce as below.

Image screenshot-stja01mstrn249finte.dxcloud.episerver.net-2018.04.06-08-55-16.png

Simple but effective.

Apr 06, 2018

Comments

Please login to comment.
Latest blogs
Optimizely release SaaS CMS

Discover the future of content management with Optimizely SaaS CMS. Enjoy seamless updates, reduced costs, and enhanced flexibility for developers...

Andy Blyth | Jul 17, 2024 | Syndicated blog

A day in the life of an Optimizely Developer - London Meetup 2024

Hello and welcome to another instalment of A Day In The Life Of An Optimizely Developer. Last night (11th July 2024) I was excited to have attended...

Graham Carr | Jul 16, 2024

Creating Custom Actors for Optimizely Forms

Optimizely Forms is a powerful tool for creating web forms for various purposes such as registrations, job applications, surveys, etc. By default,...

Nahid | Jul 16, 2024

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