diff --git a/.hgignore b/.hgignore index 55f78b6e73..ada62c6083 100644 --- a/.hgignore +++ b/.hgignore @@ -19,3 +19,4 @@ _ReSharper*/ *.suo [sS]ource [sS]andbox +umbraco.config \ No newline at end of file diff --git a/umbraco.MacroEngines.Juno/DynamicNode.cs b/umbraco.MacroEngines.Juno/DynamicNode.cs index 8f988da594..b36593dbf3 100644 --- a/umbraco.MacroEngines.Juno/DynamicNode.cs +++ b/umbraco.MacroEngines.Juno/DynamicNode.cs @@ -121,6 +121,16 @@ namespace umbraco.MacroEngines return false; } + public DynamicNode AncestorOrSelf(Func func) + { + var node = this; + while (node != null) + { + if (func(node)) return node; + node = node.Parent; + } + } + public DynamicNode Parent { get { return new DynamicNode(n.Parent); }