Class TemplateController
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
[Authorize(Policy = "TreeAccessTemplates")]
public class TemplateController : BackOfficeNotificationsController
- Inheritance
-
TemplateController
- Inherited Members
Constructors
TemplateController(IFileService, IUmbracoMapper, IShortStringHelper, IDefaultViewContentProvider)
[ActivatorUtilitiesConstructor]
public TemplateController(IFileService fileService, IUmbracoMapper umbracoMapper, IShortStringHelper shortStringHelper, IDefaultViewContentProvider defaultViewContentProvider)
Parameters
fileServiceIFileServiceumbracoMapperIUmbracoMappershortStringHelperIShortStringHelperdefaultViewContentProviderIDefaultViewContentProvider
Methods
DeleteById(int)
Deletes a template with a given ID
[HttpDelete]
[HttpPost]
public IActionResult DeleteById(int id)
Parameters
idint
Returns
GetAll()
Get all templates
public IEnumerable<EntityBasic>? GetAll()
Returns
- IEnumerable<EntityBasic>
GetByAlias(string)
Gets data type by alias
public TemplateDisplay? GetByAlias(string alias)
Parameters
aliasstring
Returns
- TemplateDisplay
GetById(Guid)
Gets the template json for the template guid
public ActionResult<TemplateDisplay?> GetById(Guid id)
Parameters
idGuid
Returns
- ActionResult<TemplateDisplay>
GetById(int)
Gets the template json for the template id
public ActionResult<TemplateDisplay?> GetById(int id)
Parameters
idint
Returns
- ActionResult<TemplateDisplay>
GetById(Udi)
Gets the template json for the template udi
public ActionResult<TemplateDisplay?> GetById(Udi id)
Parameters
idUdi
Returns
- ActionResult<TemplateDisplay>
GetScaffold(int)
public TemplateDisplay? GetScaffold(int id)
Parameters
idint
Returns
- TemplateDisplay
PostSave(TemplateDisplay)
Saves the data type
public ActionResult<TemplateDisplay> PostSave(TemplateDisplay display)
Parameters
displayTemplateDisplay
Returns
- ActionResult<TemplateDisplay>