Skip to content

Instantly share code, notes, and snippets.

@trssaunders
Created May 22, 2013 12:05
Show Gist options
  • Save trssaunders/5627055 to your computer and use it in GitHub Desktop.
Save trssaunders/5627055 to your computer and use it in GitHub Desktop.
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(',');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment