Using 4.8 I'm trying to add a custom section with a tree, and I have
I'm not at all certain what the treeHandlerType setting should be.
I have the following code so far, and this is compiled into a DLL called pps.website.Logic.dll and I wonder if the Handler type should be loadEnquiries or Tree.loadEnquiries
using System; using System.Data; using System.Data.Entity; using System.Collections.Generic; using System.Linq; using System.Web; using umbraco.cms.presentation.Trees; using pps.website.Logic.ObjectModel; namespace pps.website.Logic.Tree { public class loadEnquiries : BaseTree { private DbSet<ef5EnquiryData> enqset; public loadEnquiries(string application) : base(application) { var context = new PpsContext(); enqset = context.Enquiries; } protected override void CreateRootNode(ref XmlTreeNode rootNode) { rootNode.Icon = FolderIcon; rootNode.OpenIcon = FolderIconOpen; rootNode.NodeType = TreeAlias; rootNode.NodeID = "init"; } public override void Render(ref XmlTree tree) { foreach (ef5EnquiryData enq in enqset) { XmlTreeNode xNode = XmlTreeNode.Create(this); xNode.NodeID = enq.Id.ToString(); xNode.Text = string.Format("{0} - {1}", enq.Created, enq.Name); xNode.Icon = "enquiry.gif"; xNode.Action = "javascript:openEnquiry(" + enq.Id.ToString() + ")"; } } public override void RenderJS(ref System.Text.StringBuilder Javascript) { Javascript.Append( @" function openEnquiry(id) { parent.right.document.location.href = 'showEnquiry.aspx?id=' + id; } "); } }
No matter what I do the break points set on this are never hit and the tree never loads.
I'm also confused that there are no other rows in these tables. Is there some other way to declare the custom section / tree now?
Custom Section treeHandlerType
Using 4.8 I'm trying to add a custom section with a tree, and I have
I'm not at all certain what the treeHandlerType setting should be.
I have the following code so far, and this is compiled into a DLL called pps.website.Logic.dll and I wonder if the Handler type should be loadEnquiries or Tree.loadEnquiries
No matter what I do the break points set on this are never hit and the tree never loads.
I'm also confused that there are no other rows in these tables. Is there some other way to declare the custom section / tree now?
should"nt you be using the trees.config from /config folder instead of db entries, this has changed since v4.8
Cheers,
/Dirk
aaah o.k. had missed that change
do you know what the treeHandlerType should be?
my guess is
Tree.loadEnquiries
yup, that's correct, umbraco concats ddl name, comma and treehandlerassembly name from config (or db)
found a very useful blog post from Matt
http://blog.mattbrailsford.com/2012/07/18/creating-custom-applications-and-trees-in-umbraco-4-8/
is working on a reply...