I understand that marcos are reusable components and I think they're great. From my understanding, macros are setup by pointing to a HTML file which can read the macros paramters and use that to display content.
However, is it possible for the macros to render a controller action result instead? Let's say I have a controller called WidgetsController, and I wanted my macros to render and return the HTML of the ContentCard Action result?
I want to be able to execute custom code from a controller action, so for example I can call an API to get a set of results that would be used as data for my macros view.
Render Macros with Controller actions
I understand that marcos are reusable components and I think they're great. From my understanding, macros are setup by pointing to a HTML file which can read the macros paramters and use that to display content.
However, is it possible for the macros to render a controller action result instead? Let's say I have a controller called WidgetsController, and I wanted my macros to render and return the HTML of the ContentCard Action result?
I want to be able to execute custom code from a controller action, so for example I can call an API to get a set of results that would be used as data for my macros view.
Use this to render macro in controller action
umbraco.library.RenderMacroContent(src.BodyText, src.Id)
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@Html.Action("ShowRequestCallBackForm", "ContactFormsSurface")
is working on a reply...