Skip to content

Instantly share code, notes, and snippets.

View trssaunders's full-sized avatar

Tim Saunders trssaunders

View GitHub Profile
@trssaunders
trssaunders / GetMNTPValuesRecursively
Created May 22, 2013 12:05
Get MNTP values recursively, as you can't use the built in Umbraco method as it incorrectly detects values. i.e. string[] nodeIds = Model.GetPropertyValue(Parameter.advertSlot, true).Split(','); does not go all the way up the tree if a MNTP has previously had a value that has been subsequently deleted
string[] nodeIds = Model.AncestorOrSelf((Func<dynamic, bool>)(n => n.HasValue("fieldAliasHere"))).GetPropertyValue("fieldAliasHere").Split(',');