Table of Contents

Class TemplatesTreeController

Namespace
Umbraco.Cms.Web.BackOffice.Trees
Assembly
Umbraco.Web.BackOffice.dll
[Authorize(Policy = "TreeAccessTemplates")]
[Tree("settings", "templates", SortOrder = 6, TreeGroup = "templatingGroup")]
public class TemplatesTreeController : TreeController, ITree, ISearchableTree, IDiscoverable
Inheritance
TemplatesTreeController
Implements
ITree
ISearchableTree
IDiscoverable
Inherited Members

Constructors

TemplatesTreeController(UmbracoTreeSearcher, IMenuItemCollectionFactory, ILocalizedTextService, UmbracoApiControllerTypeCollection, IFileService, IEventAggregator)

public TemplatesTreeController(UmbracoTreeSearcher treeSearcher, IMenuItemCollectionFactory menuItemCollectionFactory, ILocalizedTextService localizedTextService, UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection, IFileService fileService, IEventAggregator eventAggregator)

Parameters

treeSearcher UmbracoTreeSearcher
menuItemCollectionFactory IMenuItemCollectionFactory
localizedTextService ILocalizedTextService
umbracoApiControllerTypeCollection UmbracoApiControllerTypeCollection
fileService IFileService
eventAggregator IEventAggregator

Methods

CreateRootNode(FormCollection)

protected override ActionResult<TreeNode?> CreateRootNode(FormCollection queryStrings)

Parameters

queryStrings FormCollection

Returns

ActionResult<TreeNode>

GetMenuForNode(string, FormCollection)

Returns the menu structure for the node

protected override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)

Parameters

id string
queryStrings FormCollection

Returns

ActionResult<MenuItemCollection>

GetTreeNodes(string, FormCollection)

The method called to render the contents of the tree structure

protected override ActionResult<TreeNodeCollection> GetTreeNodes(string id, FormCollection queryStrings)

Parameters

id string
queryStrings FormCollection

All of the query string parameters passed from jsTree

Returns

ActionResult<TreeNodeCollection>

Remarks

We are allowing an arbitrary number of query strings to be pased in so that developers are able to persist custom data from the front-end to the back end to be used in the query for model data.

SearchAsync(string, int, long, string?)

public Task<EntitySearchResults> SearchAsync(string query, int pageSize, long pageIndex, string? searchFrom = null)

Parameters

query string
pageSize int
pageIndex long
searchFrom string

Returns

Task<EntitySearchResults>