0
votes

I have a field in sitecore that is a TreeListEx. I need to support this field in the experience editor. I'm using MVC controller renderings.

I'm having difficulty finding anything that gives me any pointers in how to do this. The glass doc's don't mention TreeLists. I found this tutorial but I can't relate some of the items it talks about to my sitecore implementation. Specifically it talks about :

In core database, under /sitecore/content/Applications/WebEdit/Edit Frame Buttons, add your field, making a duplicate of the /sitecore/content/Applications/WebEdit/Edit Frame Buttons/Default folder for convenience. This will bring over with it the below items.

I don't have this setup...? The path it talks about does not exist in my sitecore. I'm guessing this is an older version (I'm on sitecore 8)

I'm 90% sure I need to use a glass mapper BeginEditFrame(). This has an overload:

public GlassEditFrame BeginEditFrame(string buttons, string dataSource);

But there appears to be no documentation on how to use this. I'm guessing datasource would be my field holding the TreeListEx but buttons I have no idea?

Has anyone implemented a TreeListEx field in experience editor using MVC (glassmapper or standard, I don't mind)?

If this is possible how?

1

1 Answers

1
votes

I managed to come up with a workaround. It appears (happy to be contridicted here) that sitecore does not support the TreeListEx (despite this being a core feature) in MVC/experience editor.

My work around was to create the items as children of the item that used them (makes the sitecore set up much more clunky but...)

enter image description here

I can then use the begin edit frame thus:

@using (Html.BeginEditFrame(Model.Path))
{
    foreach (var button in Model.Children)
    {
        <!--Use children here-->
    }
}

Note: you will need to add whatever template(s) you want to add here as the insert options (item template -> _standardValues -> Configure -> Assign (insert options menu))

You will then be able to add the items though the experience manager:

enter image description here