Table of Contents

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

fileService IFileService
umbracoMapper IUmbracoMapper
shortStringHelper IShortStringHelper
defaultViewContentProvider IDefaultViewContentProvider

Methods

DeleteById(int)

Deletes a template with a given ID

[HttpDelete]
[HttpPost]
public IActionResult DeleteById(int id)

Parameters

id int

Returns

IActionResult

GetAll()

Get all templates

public IEnumerable<EntityBasic>? GetAll()

Returns

IEnumerable<EntityBasic>

GetByAlias(string)

Gets data type by alias

public TemplateDisplay? GetByAlias(string alias)

Parameters

alias string

Returns

TemplateDisplay

GetById(Guid)

Gets the template json for the template guid

public ActionResult<TemplateDisplay?> GetById(Guid id)

Parameters

id Guid

Returns

ActionResult<TemplateDisplay>

GetById(int)

Gets the template json for the template id

public ActionResult<TemplateDisplay?> GetById(int id)

Parameters

id int

Returns

ActionResult<TemplateDisplay>

GetById(Udi)

Gets the template json for the template udi

public ActionResult<TemplateDisplay?> GetById(Udi id)

Parameters

id Udi

Returns

ActionResult<TemplateDisplay>

GetScaffold(int)

public TemplateDisplay? GetScaffold(int id)

Parameters

id int

Returns

TemplateDisplay

PostSave(TemplateDisplay)

Saves the data type

public ActionResult<TemplateDisplay> PostSave(TemplateDisplay display)

Parameters

display TemplateDisplay

Returns

ActionResult<TemplateDisplay>