Skip to content

Instantly share code, notes, and snippets.

@samandmoore
Created March 26, 2012 23:52
Show Gist options
  • Select an option

  • Save samandmoore/2210797 to your computer and use it in GitHub Desktop.

Select an option

Save samandmoore/2210797 to your computer and use it in GitHub Desktop.
@if (DynamicModel.AncestorsOrSelf.Where("metaNoegleord != @0", "null").Any()) {
<meta name="Keywords" content="@DynamicModel.AncestorsOrSelf.Where("metaNoegleord != @0", "null").First().metaNoegleord" />
}
@warrenbuckley
Copy link
Copy Markdown

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)

@samandmoore
Copy link
Copy Markdown
Author

aha! thanks a bunch, Warren!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment