4 votes

SimpleTreeMenu

A simple treemenu propertyeditor that uses a doc-type (element) for menu items.

With a valueconverter that utilize the built in nestedcontent for type conversion of menu items.
Every item can be cast to an IPublishedElement for propertyaccess through Umbracos extension-methods.

It will work without the valueconverter, just remove the binary and use JObject instead of IEnumerable<ISimpleTreeItem>


Example:

var navigationModel = Model.Value<IEnumerable<ISimpleTreeItem>>("navigation", defaultValue: new List<ISimpleTreeItem>());

@:<ul>

foreach (var item in navigationModel)
{

var element = (IPublishedElement)item;
var url = element.Value<IPublishedContent>("linkedContent")?.Url ?? element.Value<string>("linkedUrl") ?? "#";

@:<li><a href="@url">@(element.Value<string>("title"))</a></li>

if (item.Children.Any())
{
@:<ul>
foreach (var child in item.Children)
{
var cElement = (IPublishedElement)child;
@:<li>@(cElement.Value<string>("title"))</li>
}
@:</ul>
}
}

@:</ul>

 

Changes:

0.1.3

0.2

  • Issue: Fixed issue with angularjs release mode.
  • Feature: Added clone/copy
  • Minor UI changes
  • Removed default datatype and default doctype from package

0.2.2

 

  • Validate doctype
  • Dropdown doctypepicker for datatype

 

Screenshots

No current release

or, install via NuGet

Package owner

Dennis Öhman

Dennis Öhman

Dennis has 120 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.6.x (untested)
Version 8.5.x (untested)
Version 8.4.x (untested)
Version 8.3.x (100%)
Version 8.2.x (100%)
Version 8.1.x (100%)
Version 8.0.x (untested)
Version 7.15.x (untested)
Version 7.14.x (untested)
Version 7.13.x (untested)
Version 7.12.x (untested)
Version 7.11.x (untested)
Version 7.10.x (untested)
Version 7.9.x (untested)
Version 7.8.x (untested)
Version 7.7.x (untested)
Version 7.6.x (untested)
Version 7.5.x (untested)
Version 7.4.x (untested)
Version 7.3.x (untested)
Version 7.2.x (untested)
Version 7.1.x (untested)
Version 7.0.x (untested)
Version 6.2.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Dennis Öhman
  • Created: 10/11/2019
  • Current version 0.2.2
  • .NET version 4.7.2
  • License MIT
  • Downloads on Our: 231
  • Downloads on NuGet: 645
  • Total downloads : 876