Created
March 26, 2012 23:52
-
-
Save samandmoore/2210797 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @if (DynamicModel.AncestorsOrSelf.Where("metaNoegleord != @0", "null").Any()) { | |
| <meta name="Keywords" content="@DynamicModel.AncestorsOrSelf.Where("metaNoegleord != @0", "null").First().metaNoegleord" /> | |
| } |
Author
Hi
I wanted to check you was trying to do a recursive property.
It's a simple as this
@DynamicModel._metaNoegleord
@* Get the "siteName" property recursively (if not present on current page, traverse through page ancestors,
Notice this matches alias casing, but prefixes a _ char *@
@DynamicModel._siteName
@*OR, use Umbraco.Field*@
@Umbraco.Field("bodyText", recursive:True)
Author
aha! thanks a bunch, Warren!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey Warren,
Thanks. I was trying to help this guy on Jabbr yesterday and it surfaced this problem. I think essentially what im trying to do here is get a recursive property for metaNoegleord. If the does not exist on the current item then find the first ancestor that has it and display that value.
Can you help?