description |
---|
Configuring folders to organise trees in Umbraco UI Builder, the backoffice UI builder for Umbraco. |
A folder can appear in either a tree or as a sub folder to other folders. Folders can contain either other (sub)folders or collections.
You can define a folder by calling one of the AddFolder
methods on a given Tree
or parent Folder
config builder instance.
Adds a folder to the current tree with the given name and a default folder icon.
// Example
treeConfig.AddFolder("Settings", folderConfig => {
...
});
Adds a folder to the current tree with the given name + icon.
// Example
treeConfig.AddFolder("Settings", "icon-settings", folderConfig => {
...
});
Sets the alias of the folder.
Optional: When creating a new folder, an alias is automatically generated from the supplied name for you. However, if you need a specific alias you can use the SetAlias
method to override this.
// Example
folderConfig.SetAlias("settings");
Sets the folder icon color to the given color. The options that are possible are black
, green
, yellow
, orange
, blue
or red
.
// Example
folderConfig.SetIconColor("blue");
Adds a sub folder to the current folder with the given name and a default folder icon.
// Example
folderConfig.AddFolder("Categories", subFolderConfig => {
...
});
Adds a sub folder to the current folder with the given name + icon.
// Example
folderConfig.AddFolder("Categories", "icon-tags", subFolderConfig => {
...
});
AddCollection<TEntityType>(Lambda idFieldExpression, string nameSingular, string namePlural, string description, Lambda collectionConfig = null) : CollectionConfigBuilder<TEntityType>
Adds a collection to the current folder with the given names, descriptions, and default icons. An ID property accessor expression is required so that Umbraco UI Builder knows which property is the ID property. For more information check the Collections documentation.
// Example
folderConfig.AddCollection<Person>(p => p.Id, "Person", "People", "A collection of people", collectionConfig => {
...
});
AddCollection<TEntityType>(Lambda idFieldExpression, string nameSingular, string namePlural, string description, string iconSingular, string iconPlural, Lambda collectionConfig = null) : CollectionConfigBuilder<TEntityType>
Adds a collection to the current folder with the given names, description and icons. An ID property accessor expression is required so that Umbraco UI Builder knows which property is the ID property. For more information check the Collections documentation.
// Example
folderConfig.AddCollection<Person>(p => p.Id, "Person", "People", "A collection of people", "icon-umb-users", "icon-umb-users", collectionConfig => {
...
});