I've got a macro that checks a node to see if it has a value or if its parent has a property to determine what class to apply to a div.. It is pretty simple.. The problem I run in to frequently is that on the same page this macro returns different results.. Sometimes it returns nothing and other times it returns the same result (on the same page).. I turned off the caching on the macro.. Anyone have any ideas? 4.7.1
if (Model.HasProperty("sectionClasses") && !String.IsNullOrEmpty(Model.GetProperty("sectionClasses").Value)) { @Html.Raw(Model.sectionClasses).ToString() } else if (Model.Level > 1 && Model.Parent.HasProperty("childSectionClass") && !String.IsNullOrEmpty(Model.Parent.GetProperty("childSectionClass").Value)) { @Html.Raw(Model.Parent.childSectionClass).ToString() }
The macro produces a class that is used on a home page.. Sometimes the string is returned and other times it doesn't return anything all on the same page call..
Macro Inconsistently Returning Result
I've got a macro that checks a node to see if it has a value or if its parent has a property to determine what class to apply to a div.. It is pretty simple.. The problem I run in to frequently is that on the same page this macro returns different results.. Sometimes it returns nothing and other times it returns the same result (on the same page).. I turned off the caching on the macro.. Anyone have any ideas? 4.7.1
if (Model.HasProperty("sectionClasses") && !String.IsNullOrEmpty(Model.GetProperty("sectionClasses").Value))
{
@Html.Raw(Model.sectionClasses).ToString()
}
else if (Model.Level > 1 && Model.Parent.HasProperty("childSectionClass") && !String.IsNullOrEmpty(Model.Parent.GetProperty("childSectionClass").Value))
{
@Html.Raw(Model.Parent.childSectionClass).ToString()
}
The macro produces a class that is used on a home page.. Sometimes the string is returned and other times it doesn't return anything all on the same page call..
is working on a reply...