November Happy Hour will be moved to Thursday December 5th.

Scott Reed
Apr 6, 2018
  1417
(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
Adding Geolocation Personalisation to Optimizely CMS with Cloudflare

Enhance your Optimizely CMS personalisation by integrating Cloudflare's geolocation headers. Learn how my Cloudflare Geo-location Criteria package...

Andy Blyth | Nov 26, 2024 | Syndicated blog

Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog