SaaS CMS has officially launched! Learn more now.

ContentSelector in custom tools in Admin


I am converting a CMS 11 to CMS 12 and there is a custom admin tool that had a content picker enabling the user to select a page or starting node. In CMS 11 that was pretty easy, but in CMS 12 I have not seen so many working examples :) Is the a MVC example out there? :) 

I had a look at but I could not get that to work. 

I have also looked at but I would rather not go the react way, the guide also mentions 

"Something else that maybe worth looking at is the @episerver/amd-proxy-loader I mentioned previously ( With this it is possible to dynamically require AMD modules from Episerver CMS from your JavaScript application. This is framework agnostic so it can be used with whichever JavaScript framework you prefer."

But now does not seems to be maintained any longer. 

Feb 02, 2024 8:06

Have you found any working solution for this yet? :) 

Jun 18, 2024 8:56

Nikola, actually yes :) Optimizely released some web components that you can use

<optimizely-content-tree id="content-tree"></optimizely-content-tree>
<optimizely-button id="generate" buttonStyle="highlight" text="Generate"></optimizely-button>
let selectedNode = null;
document.getElementById("content-tree").addEventListener("onNodeSelected", (event) = {
selectedNode = event.detail.contentLink;

document.getElementById("generate").addEventListener("onClick", () = {
alert('sending contentLink with id = ' + selectedNode;

Jun 18, 2024 10:18

Exactly what i was looking for, thanks! 😀

Jun 19, 2024 7:20

Could you please provide some short example how to get those new web components work in MVC? I have exactly the same problem that Christian described in the first post. 

Jul 15, 2024 9:59

Hi Aleksander Rajca,

You probably need to include the @Html.RegisterOptimizelyWebComponents() helper in order for those web components to be loaded.

Jul 15, 2024 10:09

Thanks Karol! It was a piece that I was missing. Everything works perfectly now.

Jul 15, 2024 10:34
* 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.