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
parameterEditorCollectionParameterEditorCollectionmacroServiceIMacroServiceshortStringHelperIShortStringHelperbackofficeSecurityAccessorIBackOfficeSecurityAccessorloggerILogger<MacrosController>hostingEnvironmentIHostingEnvironmentumbracoMapperIUmbracoMapper
Methods
Create(string)
Creates a new macro
[HttpPost]
public ActionResult<int> Create(string name)
Parameters
namestringThe name.
Returns
- ActionResult<int>
The id of the created macro
DeleteById(int)
[HttpPost]
public IActionResult DeleteById(int id)
Parameters
idint
Returns
GetById(Guid)
[HttpGet]
public ActionResult<MacroDisplay?> GetById(Guid id)
Parameters
idGuid
Returns
- ActionResult<MacroDisplay>
GetById(int)
[HttpGet]
public ActionResult<MacroDisplay?> GetById(int id)
Parameters
idint
Returns
- ActionResult<MacroDisplay>
GetById(Udi)
[HttpGet]
public ActionResult<MacroDisplay?> GetById(Udi id)
Parameters
idUdi
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
aliasstring
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
Save(MacroDisplay)
[HttpPost]
public ActionResult<MacroDisplay> Save(MacroDisplay macroDisplay)
Parameters
macroDisplayMacroDisplay
Returns
- ActionResult<MacroDisplay>