Revision: 35587
Updated Code
at November 10, 2010 14:56 by Elijah
Updated Code
public string RenderMacro(string input, int nodeId) { if (string.IsNullOrEmpty(input)) return string.Empty; var regex = new Regex("<\\?UMBRACO_MACRO[^>]*/>", RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); return regex.Replace(input, p => { try { return umbraco.library.RenderMacroContent(p.Value, nodeId); } catch (Exception ex) { Trace.Warn(ex.Message); return "Problems Rendering Macro"; } }); }
Revision: 35586
Updated Code
at November 10, 2010 14:55 by Elijah
Updated Code
public string ParseContent(string input, int nodeId) { if (string.IsNullOrEmpty(input)) return string.Empty; var regex = new Regex("<\\?UMBRACO_MACRO[^>]*/>", RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); return regex.Replace(input, p => { try { return umbraco.library.RenderMacroContent(p.Value, nodeId); } catch (Exception ex) { Trace.Warn(ex.Message); return "Problems Rendering Macro"; } }); }
Revision: 35585
Updated Code
at November 10, 2010 14:55 by Elijah
Updated Code
public string ParseContent(string input, int nodeId) { if (string.IsNullOrEmpty(input)) return string.Empty; var regex = new Regex("<\\?UMBRACO_MACRO[^>]*/>", RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); return regex.Replace(input, p => { try { return umbraco.library.RenderMacroContent(p.Value, nodeId); } catch (Exception ex) { Trace.Warn(ex.Message); return "Problems Rendering Macro"; } }); }
Revision: 35584
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 10, 2010 14:54 by Elijah
Initial Code
public string ParseContent(string input, int nodeId) { if (string.IsNullOrEmpty(input)) return string.Empty; var regex = new Regex("<\\?UMBRACO_MACRO[^>]*/>", RegexOptions.Multiline | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); return regex.Replace(input, p => { try { return umbraco.library.RenderMacroContent(p.Value, nodeId); } catch (Exception ex) { Trace.Warn(ex.Message); return "Problems Rendering Macro"; } }); }
Initial URL
Initial Description
Initial Title
Umbraco Render Macro Inside A String
Initial Tags
Initial Language
C#