diff --git a/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicBackingItem.cs b/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicBackingItem.cs index 82c9bbdd37..e9a1e5362b 100644 --- a/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicBackingItem.cs +++ b/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicBackingItem.cs @@ -198,15 +198,27 @@ namespace umbraco.MacroEngines public IProperty GetProperty(string alias, bool recursive) { - if (!recursive) return GetProperty(alias); - if (IsNull()) return null; + bool propertyExists = false; + return GetProperty(alias, recursive, out propertyExists); + } + public IProperty GetProperty(string alias, bool recursive, out bool propertyExists) + { + if (!recursive) + { + return GetProperty(alias, out propertyExists); + } + if (IsNull()) + { + propertyExists = false; + return null; + } DynamicBackingItem context = this; - IProperty prop = this.GetProperty(alias); - while (prop == null) + IProperty prop = this.GetProperty(alias, out propertyExists); + while (prop == null || string.IsNullOrEmpty(prop.Value)) { context = context.Parent; - prop = context.GetProperty(alias); if (context == null) break; + prop = context.GetProperty(alias, out propertyExists); } if (prop != null) { diff --git a/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicNode.cs b/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicNode.cs index f7d125e54b..9eec1dc211 100644 --- a/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicNode.cs +++ b/umbraco.MacroEngines.Juno/RazorDynamicNode/DynamicNode.cs @@ -383,11 +383,17 @@ namespace umbraco.MacroEngines bool propertyExists = false; if (n != null) { - var data = n.GetProperty(name, out propertyExists); + bool recursive = false; + if (name.StartsWith("_")) + { + name = name.Substring(1, name.Length - 1); + recursive = true; + } + var data = n.GetProperty(name, recursive, out propertyExists); // check for nicer support of Pascal Casing EVEN if alias is camelCasing: if (data == null && name.Substring(0, 1).ToUpper() == name.Substring(0, 1) && !propertyExists) { - data = n.GetProperty(name.Substring(0, 1).ToLower() + name.Substring((1)), out propertyExists); + data = n.GetProperty(name.Substring(0, 1).ToLower() + name.Substring((1)), recursive, out propertyExists); } if (data != null) @@ -517,7 +523,7 @@ namespace umbraco.MacroEngines //integer int iResult = 0; - if (int.TryParse(string.Format("{0}", result), System.Globalization.NumberStyles.Number, System.Globalization.CultureInfo.CurrentCulture, out iResult)) + if (int.TryParse(string.Format("{0}", result), System.Globalization.NumberStyles.Number, System.Globalization.CultureInfo.CurrentCulture, out iResult)) { result = iResult; return true;