This package is exclusively for V5 of Umbraco, so please do not try to install it in a version 4 Umbraco site.
This package installs a new property editor to allow you to select a single child node from a dropdown list which stores the HiveID. Allowing you to use this value and fetch that node in your Razor code.
The property has one value that you can retrieve from it to use in your Razor code:
· SelectedChildContentId
For example if your current page has the Child Content property with the alias of 'anotherNode' you could for example retrieve that node in your Razor to work with.
@{
var childPageID = DynamicModel.anotherNode;
var childPageAsDynamic = Umbraco.GetDynamicContentById(childPageID);
}
<h1>@childPageAsDynamic.Name</h1>
@if(childPageAsDynamic.Children.Any())
{
<ul>
@foreach(var page in childPageAsDynamic.Children)
{
<li><a href="@page.Url">@page.Name</a></li>
}
</ul>
}