View Source
Class MacroRenderingController
API controller to deal with Macro data
Inheritance
System.Object
Microsoft.AspNetCore.Mvc.ControllerBase
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class MacroRenderingController : UmbracoAuthorizedJsonController
Constructors
View Source
MacroRenderingController(IUmbracoMapper, IUmbracoComponentRenderer, IVariationContextAccessor, IMacroService, IUmbracoContextAccessor, IShortStringHelper, ISiteDomainMapper)
Declaration
public MacroRenderingController(IUmbracoMapper umbracoMapper, IUmbracoComponentRenderer componentRenderer, IVariationContextAccessor variationContextAccessor, IMacroService macroService, IUmbracoContextAccessor umbracoContextAccessor, IShortStringHelper shortStringHelper, ISiteDomainMapper siteDomainHelper)
Parameters
Type |
Name |
Description |
IUmbracoMapper |
umbracoMapper |
|
IUmbracoComponentRenderer |
componentRenderer |
|
IVariationContextAccessor |
variationContextAccessor |
|
IMacroService |
macroService |
|
IUmbracoContextAccessor |
umbracoContextAccessor |
|
IShortStringHelper |
shortStringHelper |
|
ISiteDomainMapper |
siteDomainHelper |
|
Methods
View Source
CreatePartialViewMacroWithFile(MacroRenderingController.CreatePartialViewMacroWithFileModel)
Declaration
[HttpPost]
public IActionResult CreatePartialViewMacroWithFile(MacroRenderingController.CreatePartialViewMacroWithFileModel model)
Parameters
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.IActionResult |
|
View Source
GetMacroParameters(Int32)
Gets the macro parameters to be filled in for a particular macro
Declaration
public ActionResult<IEnumerable<MacroParameter>> GetMacroParameters(int macroId)
Parameters
Type |
Name |
Description |
System.Int32 |
macroId |
|
Returns
Type |
Description |
Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<MacroParameter>> |
|
View Source
GetMacroResultAsHtmlForEditor(String, Int32, IDictionary<String, Object>)
Declaration
[HttpGet]
public async Task<IActionResult> GetMacroResultAsHtmlForEditor(string macroAlias, int pageId, [FromQuery] IDictionary<string, object> macroParams)
Parameters
Type |
Name |
Description |
System.String |
macroAlias |
|
System.Int32 |
pageId |
|
IDictionary<System.String, System.Object> |
macroParams |
|
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.IActionResult> |
|
View Source
GetMacroResultAsHtmlForEditor(MacroRenderingController.MacroParameterModel)
Gets a rendered macro as HTML for rendering in the rich text editor.
Using HTTP POST instead of GET allows for more parameters to be passed as it's not dependent on URL-length
limitations like GET.
The method using GET is kept to maintain backwards compatibility
Declaration
[HttpPost]
public async Task<IActionResult> GetMacroResultAsHtmlForEditor(MacroRenderingController.MacroParameterModel model)
Parameters
Returns
Type |
Description |
Task<Microsoft.AspNetCore.Mvc.IActionResult> |
|