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";
tree.Add(mynode);
var myothernode = CreateTreeNode ("2", "-1", queryStrints, "my other node");
myothernode.NodeType = "my node type is B";
tree.Add(myothernode);
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.
Reading nodetype when assigning actions to a menu. Umbraco 7
Hi All
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.
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
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...