When using fallback to ancestor together with default value, i do not get any value in return, if there a value in one of the ancestors "resonOneTitle" field.
But if i remove the value from all the ancestors, then i get the default value as expected.
If i only call for the ancestor as fallback then it works perfectly, and returns the value from the first ancestor.
Fallback to ancestor + defaultvalue not working
Hi.
When using fallback to ancestor together with default value, i do not get any value in return, if there a value in one of the ancestors "resonOneTitle" field.
But if i remove the value from all the ancestors, then i get the default value as expected.
If i only call for the ancestor as fallback then it works perfectly, and returns the value from the first ancestor.
The code is inside a partial containing:
If i do either of these, then it works just fine
Your problem is this
new HtmlString("Default page title")
it should just be a string.Thanks! That worked.!
I was using the code from the docs:
https://our.umbraco.com/documentation/Fundamentals/Design/Rendering-Content/#:~:text=In%20this%20example%2C%20we%20are%20looking%20for%20content%20firstly%20on%20the%20current%20node%20for%20the%20default%20language%2C%20and%20if%20not%20found%20we%27ll%20search%20through%20the%20ancestors.%20If%20failing%20to%20find%20any%20populated%20value%20from%20them%2C%20we%27ll%20use%20the%20provided%20default%3A
It would seem the doc is incorrect :D
I ran a few tests and it only worked when I passed it a normal string.
Dammit! I was so frustrated yesterday xD
Thanks for helping me out, yet again ;)
is working on a reply...