A tree is a hierarchical structure that helps organise a section into logical sub-sections and is accessed in the main side panel of the Umbraco interface. In Konstrukt, a section may only have a single tree definition, however you can use folder nodes to help organise the tree structure how you need it.
Configuring a Konstrukt section tree
The tree configuration for Konstrukt sections is a sub configuration of a Section config builder instance and is accessed via it's Tree method.
The tree configuration for existing sections is a sub configuration of a WithSection config builder instance and is accessed via one of it's AddTree methods.
Sets the trees icon color to the given color. Possible options are black, green, yellow, orange, blue or red.
NB: Only trees added to existing sections have an icon. Trees added to Konstrukt sections don't show a tree icon instead they go straight into displaying the tree contents.
Adds a collection to the current tree / group with the given names and description and default icons. An ID property accessor expression is required so that Konstrukt knows which property is the ID property. See the Collections documentation for more info.
// ExampletreeConfig.AddCollection<Person>(p =>p.Id,"Person","People","A collection of people", collectionConfig => {...});
Adds a collection to the current tree / group with the given names, description and icons. An ID property accessor expression is required so that Konstrukt knows which property is the ID property. See the Collections documentation for more info.
// ExampletreeConfig.AddCollection<Person>(p => p.Id, "Person", "People", "A collection of people", "icon-umb-users", "icon-umb-users", collectionConfig => {
...});
Extending an existing tree
You can extend existing trees adding Konstrukt context apps and virtual sub trees by calling the WithTree method of a KonstruktWithSectionConfigBuilder instance.
Adds a context app to the Umbraco menu with the given name and icon before the context app with the given alias. See the Context App documentation for more info.
Adds a context app to the Umbraco menu with the given name and icon after the context app with the given alias. See the Context App documentation for more info.