public static string RenderMacro(string alias, int nodeId, Dictionary<string string=> parameters)
{
var macroEngine = new RazorMacroEngine();
var macro = new MacroModel();
macro.ScriptLanguage = "cshtml";
macro.ScriptName = alias + ".cshtml";
foreach (var parameter in parameters)
{
macro.Properties.Add(new MacroPropertyModel(parameter.Key, parameter.Value));
}
return macroEngine.Execute(macro, new umbraco.NodeFactory.Node(nodeId));
}
This is the code that wasn't working:
umbraco.library.RenderMacroContent(string.Format("</?UMBRACO_MACRO>", alias, args), model.Id)
No comments:
Post a Comment