Using optimizely-content-tree web component

Hi

Following on from this older question I am trying to use the optimizely-content-tree web component in an admin view, to allow users to select a node in the content as a starting point for a content activity search. I have added the component to a view inside a div containing a call to @Html.ApplyPlatformNavigation() and a call to @Html.Raw(Html.RegisterOptimizelyWebComponents()) which seems to cause the page to load optimizely-web-components.js. But when the page loads there is a Javascript exception - TypeError: Cannot read properties of undefined (reading 'value') - in optimizely-web-components.js and the button that would open the content tree is not displayed. Has anyone else had this problem? I can get it to work if I use the layout file /CmsUIViews/Views/Shared/CommonLayout.cshtml as suggested in the older post, so all is not lost, but we do have a custom admin layout that I'd prefer to use for consistency. 

Thanks,

Daniel Lack

#342979
Jul 07, 2026 15:35

Hi Daniel,

This looks more like a CMS UI layout/bootstrap issue than a problem with optimizely-content-tree

RegisterOptimizelyWebComponents() loads the web components, but it does not provide everything that CommonLayout.cshtml adds around the CMS UI:

  • shell resources
  • theme
  • XSRF setup
  • platform navigation initialization

Since it works with:

/CmsUIViews/Views/Shared/CommonLayout.cshtml

I would compare the rendered HTML from both layouts and check what your custom layout is missing

 

Cheers,
Wojciech

#342986
Jul 08, 2026 20:16

Thanks Wojciech, I'll look into that.

Cheers,

Daniel

#342989
Jul 09, 2026 8:24
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.