HTML not rendering in section of the Umbraco backoffice after creating Tree
i am trying to create custom section named UMTDirectory, and create necessary files under App_Plugins folder by following this link , but unfortunately am unable to render the view in back-office however it appears in menu. following is the structure of folder.
package.manifest code below
<h1>Love and compassion are necessities, not luxuries </h1>
<div ng-controller="My.PersonPickerController">
<ul>
<li ng-repeat="person in people">
<a href ng-click="model.value = person.Name">{{person.Name}}</a>
</li>
</ul>
</div>
umtDirectory.resource.js
angular.module('umbraco.resources').factory('personResource',
function($q, $http, umbRequestHelper) {
// the factory object returned
return {
// this calls the ApiController we setup earlier
getAll: function () {
return umbRequestHelper.resourcePromise(
$http.get("backoffice/My/PersonApi/GetAll"),
"Failed to retrieve all Person data");
}
};
}
);
Directory Controller
namespace MyProj.Controllers
{
[Tree("umtDirectory", "umtDirectoryAlias", TreeTitle = "UMT Directory", SortOrder = 5)]
[PluginController("umtDirectory")]
public class DirectoryController : TreeController
{
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
// check if we're rendering the root node's children
if (id == Constants.System.Root.ToInvariantString())
{
// you can get your custom nodes from anywhere, and they can represent anything...
Dictionary<int, string> favouriteThings = new Dictionary<int, string>();
//favouriteThings.Add(1, "Add Faculty/Staff Member");
// create our node collection
var nodes = new TreeNodeCollection();
// loop through our favourite things and create a tree item for each one
foreach (var thing in favouriteThings)
{
// add each node to the tree collection using the base CreateTreeNode method
// it has several overloads, using here unique Id of tree item, -1 is the Id of the parent node to create, eg the root of this tree is -1 by convention - the querystring collection passed into this route - the name of the tree node - css class of icon to display for the node - and whether the item has child nodes
var node = CreateTreeNode(thing.Key.ToString(), "-1", queryStrings, thing.Value, "icon-presentation", false);
nodes.Add(node);
}
return nodes;
}
// this tree doesn't support rendering more than 1 level
throw new NotSupportedException();
}
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
// create a Menu Item Collection to return so people can interact with the nodes in your tree
var menu = new MenuItemCollection();
if (id == Constants.System.Root.ToInvariantString())
{
// root actions, perhaps users can create new items in this tree, or perhaps it's not a content tree, it might be a read only tree, or each node item might represent something entirely different...
// add your menu item actions or custom ActionMenuItems
menu.Items.Add(new CreateChildEntity(Services.TextService));
// add refresh menu item (note no dialog)
menu.Items.Add(new RefreshNode(Services.TextService, true));
return menu;
}
// add a delete action to each individual item
menu.Items.Add<ActionDelete>(Services.TextService, true, opensDialog: true);
return menu;
}
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
//optionally setting a routepath would allow you to load in a custom UI instead of the usual behaviour for a tree
//root.RoutePath = "umtDirectory"; //string.Format("{0}/{1}", "umtDirectory", "umtDirectory.html");
// set the icon
root.Icon = "icon-hearts";
// set to false for a custom tree with a single node.
root.HasChildren = false;
//url for menu
root.MenuUrl = null;
return root;
}
}
}
HTML not rendering in section of the Umbraco backoffice after creating Tree
i am trying to create custom section named UMTDirectory, and create necessary files under App_Plugins folder by following this link , but unfortunately am unable to render the view in back-office however it appears in menu. following is the structure of folder. package.manifest code below
umtDirectory.controller.js
umtDirectory.html
umtDirectory.resource.js
Directory Controller
what i see in backoffice is
please help
Thanks for your time
is working on a reply...