The following is what I have working so far. But if you happen to know how I can capitlize on this further, than I'm all for it. For now this is working for me...
var mconHome = Umbraco.TypedContentAtRoot().First().Descendants().Where(c => c.DocumentTypeAlias.Equals("conHome"));
foreach (var item in mconHome)
{
var mmeganav = item.GetPropertyValue<IEnumerable<MeganavItem>>("topMenu");
if (mmeganav != null)
{
<ul>
@foreach (var childitem in mmeganav)
{
<li>
<a href="@childitem.Url" target="@childitem.Target">@childitem.Title </a>
</li>
}
</ul>
}
}
How to reference a property from another page without depending on a Content Node ID, in Views (Razor)
I'm on Umbraco 7.7.8. In my Views, I am working on a template that should reference a property from a specific content node.
Can we do something like this in our templates...
My thought process...
Get to the root of the content tree.
Descend down one level to find a content node that is referencing a document type by the name of
conHome
.Once I am connected, get a property value on it, called
topMenu
.Thanks for any thoughts
The following is what I have working so far. But if you happen to know how I can capitlize on this further, than I'm all for it. For now this is working for me...
is working on a reply...