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 4496 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
8.1.x (untested)
8.0.x (untested)
7.14.x (untested)
7.13.x (untested)
7.12.x (untested)
7.11.x (untested)
7.10.x (untested)
7.9.x (untested)
7.8.x (untested)
7.7.x (untested)
7.6.x (untested)
7.5.x (untested)
7.4.x (untested)
7.3.x (untested)
7.2.x (untested)
7.1.x (untested)
7.0.x (untested)
6.1.x (untested)
6.0.x (untested)

You must login before you can report on package compatibility.

Package Information

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