Table of Contents

Class MacrosController

Namespace
Umbraco.Cms.Web.BackOffice.Controllers
Assembly
Umbraco.Web.BackOffice.dll

The API controller used for editing dictionary items

[Authorize(Policy = "TreeAccessMacros")]
public class MacrosController : BackOfficeNotificationsController
Inheritance
MacrosController
Inherited Members

Constructors

MacrosController(ParameterEditorCollection, IMacroService, IShortStringHelper, IBackOfficeSecurityAccessor, ILogger<MacrosController>, IHostingEnvironment, IUmbracoMapper)

public MacrosController(ParameterEditorCollection parameterEditorCollection, IMacroService macroService, IShortStringHelper shortStringHelper, IBackOfficeSecurityAccessor backofficeSecurityAccessor, ILogger<MacrosController> logger, IHostingEnvironment hostingEnvironment, IUmbracoMapper umbracoMapper)

Parameters

parameterEditorCollection ParameterEditorCollection
macroService IMacroService
shortStringHelper IShortStringHelper
backofficeSecurityAccessor IBackOfficeSecurityAccessor
logger ILogger<MacrosController>
hostingEnvironment IHostingEnvironment
umbracoMapper IUmbracoMapper

Methods

Create(string)

Creates a new macro

[HttpPost]
public ActionResult<int> Create(string name)

Parameters

name string

The name.

Returns

ActionResult<int>

The id of the created macro

DeleteById(int)

[HttpPost]
public IActionResult DeleteById(int id)

Parameters

id int

Returns

IActionResult

GetById(Guid)

[HttpGet]
public ActionResult<MacroDisplay?> GetById(Guid id)

Parameters

id Guid

Returns

ActionResult<MacroDisplay>

GetById(int)

[HttpGet]
public ActionResult<MacroDisplay?> GetById(int id)

Parameters

id int

Returns

ActionResult<MacroDisplay>

GetById(Udi)

[HttpGet]
public ActionResult<MacroDisplay?> GetById(Udi id)

Parameters

id Udi

Returns

ActionResult<MacroDisplay>

GetGroupedParameterEditors()

Gets the available parameter editors grouped by their group.

public IDictionary<string, IEnumerable<IDataEditor>> GetGroupedParameterEditors()

Returns

IDictionary<string, IEnumerable<IDataEditor>>

The HttpResponseMessage.

GetParameterEditorByAlias(string)

Get parameter editor by alias.

public IDataEditor? GetParameterEditorByAlias(string alias)

Parameters

alias string

Returns

IDataEditor

The HttpResponseMessage.

GetParameterEditors()

Gets the available parameter editors

public ParameterEditorCollection GetParameterEditors()

Returns

ParameterEditorCollection

The HttpResponseMessage.

GetPartialViews()

Gets a list of available macro partials

public IEnumerable<string> GetPartialViews()

Returns

IEnumerable<string>

The HttpResponseMessage.

Save(MacroDisplay)

[HttpPost]
public ActionResult<MacroDisplay> Save(MacroDisplay macroDisplay)

Parameters

macroDisplay MacroDisplay

Returns

ActionResult<MacroDisplay>