Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello, I was wondering if it was still possible to use recursive?
In umbraco 7 it was Model.Content.GetPropertyValue< string >("PropertyName", true)
What is it in Umbraco v8?
Thank you.
Hi Samuel
Yes this is still possible in V8, the syntax is a little different though, you now specify a Fallback option, for how the value should 'fall back' if it is null:
So in your example
Model.Content.GetPropertyValue<string>("PropertyName", true)
would become
Model.Value<string>("PropertyName", fallback: Fallback.ToAncestors)
See a list of options in the documentation here for fallbacks:
https://our.umbraco.com/Documentation/Reference/Querying/IPublishedContent/Properties#fallbacks
regards
Marc
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to use recursive with Umbraco v8?
Hello, I was wondering if it was still possible to use recursive?
In umbraco 7 it was Model.Content.GetPropertyValue< string >("PropertyName", true)
What is it in Umbraco v8?
Thank you.
Hi Samuel
Yes this is still possible in V8, the syntax is a little different though, you now specify a Fallback option, for how the value should 'fall back' if it is null:
So in your example
would become
See a list of options in the documentation here for fallbacks:
https://our.umbraco.com/Documentation/Reference/Querying/IPublishedContent/Properties#fallbacks
regards
Marc
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.