GingerSquirrel
4/27/2017 - 9:55 AM

Pull macro ID through to macro in Umbraco. This is so the properties of the doctype associated with the macro can be pulled through.

Pull macro ID through to macro in Umbraco. This is so the properties of the doctype associated with the macro can be pulled through.

Macro Parameters:

Alias: widgetId
Name: WidgetId
Type: Numeric
Sort: 0

When rendering Macro:

@Umbraco.RenderMacro("MacroName", new {widgetid=@item.Id})

Inside Parital View Macro:

@{	
  var widgetid = Model.MacroParameters["widgetid"];
  var selection = Umbraco.Content(@widgetid);
}