Class MacroRenderingController
- Namespace
- Umbraco.Cms.Web.BackOffice.Controllers
- Assembly
- Umbraco.Web.BackOffice.dll
API controller to deal with Macro data
public class MacroRenderingController : UmbracoAuthorizedJsonController
- Inheritance
-
MacroRenderingController
- Inherited Members
Constructors
MacroRenderingController(IUmbracoMapper, IUmbracoComponentRenderer, IVariationContextAccessor, IMacroService, IUmbracoContextAccessor, IShortStringHelper, ISiteDomainMapper)
public MacroRenderingController(IUmbracoMapper umbracoMapper, IUmbracoComponentRenderer componentRenderer, IVariationContextAccessor variationContextAccessor, IMacroService macroService, IUmbracoContextAccessor umbracoContextAccessor, IShortStringHelper shortStringHelper, ISiteDomainMapper siteDomainHelper)
Parameters
umbracoMapperIUmbracoMappercomponentRendererIUmbracoComponentRenderervariationContextAccessorIVariationContextAccessormacroServiceIMacroServiceumbracoContextAccessorIUmbracoContextAccessorshortStringHelperIShortStringHelpersiteDomainHelperISiteDomainMapper
Methods
CreatePartialViewMacroWithFile(CreatePartialViewMacroWithFileModel)
[HttpPost]
public IActionResult CreatePartialViewMacroWithFile(MacroRenderingController.CreatePartialViewMacroWithFileModel model)
Parameters
Returns
GetMacroParameters(int)
Gets the macro parameters to be filled in for a particular macro
public ActionResult<IEnumerable<MacroParameter>> GetMacroParameters(int macroId)
Parameters
macroIdint
Returns
- ActionResult<IEnumerable<MacroParameter>>
Remarks
Note that ALL logged in users have access to this method because editors will need to insert macros into rte (content/media/members) and it's used for inserting into templates/views/etc... it doesn't expose any sensitive data.
GetMacroResultAsHtmlForEditor(string, int, IDictionary<string, object>)
[HttpGet]
public Task<IActionResult> GetMacroResultAsHtmlForEditor(string macroAlias, int pageId, IDictionary<string, object> macroParams)
Parameters
macroAliasstringpageIdintmacroParamsIDictionary<string, object>
Returns
GetMacroResultAsHtmlForEditor(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
[HttpPost]
public Task<IActionResult> GetMacroResultAsHtmlForEditor(MacroRenderingController.MacroParameterModel model)