Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I can't seem to work out how to read back nodetype data from dynamically created nodes in a custom section tree.
I'm creating my nodes dynamically. They reference data stored in a seperate table and aren't actual "umbraco" nodes.
I'm displaying them using a tree in a new custom section.
var tree = new Umbraco.Web.Models.Trees.TreeNodeCollection();
var mynode = CreateTreeNode("1", "-1", queryStrings, "my node");
mynode.NodeType = "my node type is A";
var myothernode = CreateTreeNode ("2", "-1", queryStrints, "my other node");
myothernode.NodeType = "my node type is B";
This build up my nodes nicely, and I have a multi level tree.However when I try to work out what nodetype I'm looking at as I attach the actions, I get stuck
protected override Umbraco.Web.Models.Trees.MenuItemCollection GetMenuForModel(string id, FormDataCollection queryStrings)
//how do I get the nodetype??
if(nodetype == "foo")
menu.Items.Add(blah blah blah)
I've tried looking at the queryStrings, thinking I could put something in there, but I can't see how to add items to a FormDataCollection from my code.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted