Search Results for

    Show / Hide Table of Contents
    View Source

    Class MacroRenderingController

    API controller to deal with Macro data

    Inheritance
    System.Object
    Microsoft.AspNetCore.Mvc.ControllerBase
    UmbracoApiControllerBase
    UmbracoApiController
    UmbracoAuthorizedApiController
    UmbracoAuthorizedJsonController
    Namespace: Umbraco.Cms.Web.BackOffice.Controllers
    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
    Type Name Description
    MacroRenderingController.CreatePartialViewMacroWithFileModel model
    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>>
    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.

    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
    Type Name Description
    MacroRenderingController.MacroParameterModel model
    Returns
    Type Description
    Task<Microsoft.AspNetCore.Mvc.IActionResult>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MacroRenderingController(IUmbracoMapper, IUmbracoComponentRenderer, IVariationContextAccessor, IMacroService, IUmbracoContextAccessor, IShortStringHelper, ISiteDomainMapper)
    • Methods
      • CreatePartialViewMacroWithFile(MacroRenderingController.CreatePartialViewMacroWithFileModel)
      • GetMacroParameters(Int32)
      • GetMacroResultAsHtmlForEditor(String, Int32, IDictionary<String, Object>)
      • GetMacroResultAsHtmlForEditor(MacroRenderingController.MacroParameterModel)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX