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
-
ITreeISearchableTreeIDiscoverable
- 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
treeSearcherUmbracoTreeSearchermenuItemCollectionFactoryIMenuItemCollectionFactorylocalizedTextServiceILocalizedTextServiceumbracoApiControllerTypeCollectionUmbracoApiControllerTypeCollectionfileServiceIFileServiceeventAggregatorIEventAggregator
Methods
CreateRootNode(FormCollection)
protected override ActionResult<TreeNode?> CreateRootNode(FormCollection queryStrings)
Parameters
queryStringsFormCollection
Returns
- ActionResult<TreeNode>
GetMenuForNode(string, FormCollection)
Returns the menu structure for the node
protected override ActionResult<MenuItemCollection> GetMenuForNode(string id, FormCollection queryStrings)
Parameters
idstringqueryStringsFormCollection
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
idstringqueryStringsFormCollectionAll 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
Returns
- Task<EntitySearchResults>