3 votes

Child Content Property Editor

This package is exclusively for V5 of Umbraco, so please do not try to install it in a version 4 Umbraco site.

Description

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.

Documentation

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>
}

 

Screenshots

Package owner

Warren Buckley

Warren Buckley

Warren has 4836 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.18.x (untested)

You must login before you can report on package compatibility.

Previously reported to work on versions:

Package Information

  • Package owner: Warren Buckley
  • Created: 17/02/2012
  • Current version 1.0.0
  • License MIT
  • Downloads on Our: 822