I am trying to build a new section in Umbraco 7.6.
I had this working the 'old' way that use the tree controller extending from BaseTree but it was very ugly.
I'm now trying to do it using TreeController. I have followed the tutorials by:
Kevin Giszewski (https://github.com/kgiszewski/LearnUmbraco7/blob/master/Chapter%2016%20-%20Custom%20Sections%2C%20Trees%20and%20Actions/01%20-%20Create%20a%20Section.md)
and another by Tim Geyssens (https://github.com/TimGeyssens/UmbracoAngularBackofficePages)
but all I'm getting is an empty section without the tree and just with the title:
The controllers are not even hit on debugging, no console errors, no 500 errors, all compiles fine too.
using umbraco.businesslogic;
using umbraco.interfaces;
namespace UmbracoBookshelf.Applications
{
[Application("UmbracoBookshelf", "Umbraco Bookshelf", "icon-globe-inverted-america", 5)]
public class UmbracoBookshelfApplication : IApplication
{
}
}
Tree controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web;
using umbraco;
using umbraco.BusinessLogic.Actions;
using Umbraco.Core;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
namespace UmbracoBookshelf.Controllers
{
[PluginController("UmbracoBookshelf")]
[Umbraco.Web.Trees.Tree("UmbracoBookshelf", "UmbracoBookshelfTree", "Umbraco Bookshelf", iconClosed: "icon-folder")]
public class UmbracoBookshelfTreeController : TreeController
{
protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForNode(string id, System.Net.Http.Formatting.FormDataCollection queryStrings)
{
var menu = new MenuItemCollection();
if (id == Constants.System.Root.ToInvariantString())
{
// root actions
menu.Items.Add<CreateChildEntity, ActionNew>(ui.Text("actions", ActionNew.Instance.Alias));
menu.Items.Add<RefreshNode, ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
return menu;
}
else
{
//menu.DefaultMenuAlias = ActionDelete.Instance.Alias;
menu.Items.Add<ActionDelete>(ui.Text("actions", ActionDelete.Instance.Alias));
}
return menu;
}
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
var nodes = new TreeNodeCollection();
nodes.Add(CreateTreeNode("123", "456", queryStrings, "Some name to be shown"));
nodes.Add(CreateTreeNode("789", "456", queryStrings, "Some other name to be shown"));
return nodes;
}
}
}
Trouble disaplying custom section in Umbraco 7.6
I am trying to build a new section in Umbraco 7.6.
I had this working the 'old' way that use the tree controller extending from BaseTree but it was very ugly.
I'm now trying to do it using TreeController. I have followed the tutorials by:
Kevin Giszewski (https://github.com/kgiszewski/LearnUmbraco7/blob/master/Chapter%2016%20-%20Custom%20Sections%2C%20Trees%20and%20Actions/01%20-%20Create%20a%20Section.md)
and another by Tim Geyssens (https://github.com/TimGeyssens/UmbracoAngularBackofficePages)
but all I'm getting is an empty section without the tree and just with the title:
The controllers are not even hit on debugging, no console errors, no 500 errors, all compiles fine too.
Here's my code:
trees.config:
applications.config:
Section:
Tree controller:
It's pretty simple, what could wrong here?
is working on a reply...