Tree & Sections
# package-development
r
Umbraco 14 what is the glue between the Tree and a Section? Can;t find it really in blog posts and also not in Umbracom source...
w
I haven't looked so dont know, but my gut would be its associated in the manifest
Maybe even with a condition like a dashboard, you say what section you want it to show in
r
Yeah my guess as well but can't see the glue there... Like dashboards etc
w
But I am sure @Kevin Jump has probably done this by now
m
Its a condition but I cant recall what it is
Its for sure in Kevins blog posts somwhere as thats what I have been following
k
If you are doing a full on tree its Section -> sectionSidebarApp (has a menu) -> menu -> menuItem -> tree
(i suspect you need
sectionSideBarApp
)
but if you are not rendering things with uniqueIds (e.g documents, in my case servers). then menuItems are way easier to add to a menu, and then you don't need to go near writing all the code to get a tree working !
r
yeah sidebar app is in. is the glue the entitytype in this case?
k
my working example of a tree is a little complicated at the moment because we do custom extension points for uSync but the publisher tree looks like this. https://cdn.discordapp.com/attachments/1248205814527954944/1248210081292619776/image.png?ex=6662d5ba&is=6661843a&hm=bc487c1414b7a2d1f0a7e317be71e95c2bc5626e914de732f96b65a423f840ec&
r
I had a little mismatch I thing Where I thought I could render the root items directly from the API but root is just root in the menu and there you can select children.. WIlld diig further at least I have a menu item now 🙂
k
I would say if you don't think you need entities (e.g these are 'just' actions on a menu) then don't render a tree, its a complete pain, instead render menu items and you can even render your own items below them. I think @Matt Brailsford might have done a blog post on extending and if you look at the usync code. we render the main uSync item in the section and then that renders sub extension items. https://github.com/KevinJump/uSync/blob/v14/dev/uSync.Backoffice.Management.Client/usync-assets/src/tree/manifest.ts
So in uSync. we have our own menu element : https://github.com/KevinJump/uSync/blob/v14/dev/uSync.Backoffice.Management.Client/usync-assets/src/tree/usync.menu-element.ts and this means we can render a menu, and then anything that impliments a ManifestuSyncMenuItem beneath it. e.g
Copy code
js
const exporterMenuItem: ManifestuSyncMenuItem = {
    type: 'usync-menuItem',
    alias: 'usync.exporter.menu.item',
    name: 'Exporter',
    weight: 100,
    meta: {
        label: 'Exporter',
        icon: uSyncExporter.icon,
        entityType: 'usync-exporter-element',
        menus: ['usync.menu'],
    },
};
this might seem a bit faffy, but its way less complicated then getting a tree to work client/server 🙂
also all client side.
r
Nice, was indeed a bit complicated to setup Super Tak
2 Views