Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bunnynut 129 posts 311 karma points
    Aug 27, 2013 @ 22:36
    Bunnynut
    0

    Nodes under new section not added in Umbraco 6

    Hi there,

    Im using Umbraco 6.1.2 and im trying to add a custom section.
    I added the following code to the applications.config:
    <add alias="contact" name="Contactbeheer" icon=".traycontact" sortOrder="7" />

    And the following to trees.config:
    <add application="contact" alias="contactTree" sortOrder="1" title="Contactmomenten" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" type="Contact, WHeemskerk" />

    The section shows up in the tray at the bottom of the page and when clicking it, it shows a rootnode.
    I have added the class Contact to added subnodes with the following code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using umbraco.cms.presentation.Trees;
    using umbraco.businesslogic;
    using System.Text;

    /// <summary>
    /// Summary description for Contact
    /// </summary>
    [Tree("contact", "contactTree", "Contactmomenten")]
    public class Contact : BaseTree
    {
      public Contact(string application)
        : base(application)
      {
        //
        // TODO: Add constructor logic here
        //
      }

      protected override void CreateRootNode(ref XmlTreeNode rootNode)
      {

        rootNode.Icon = FolderIcon;
        rootNode.OpenIcon = FolderIconOpen;
        rootNode.NodeType = TreeAlias;
        rootNode.NodeID = "init";
      }

      public override void RenderJS(ref StringBuilder Javascript)
      {

        Javascript.Append(
          @"
            function openObject(id)
             {
              parent.right.document.location.href = ‘/umbraco/plugins/handledContact.aspx’;
             }
          ");
      }

      public override void Render(ref XmlTree tree)
      {
        XmlTreeNode node = XmlTreeNode.Create(this);
        node.NodeID = "1"; //b.Id.ToString();
        node.Text = "Niet behandeld";
        node.Icon = FolderIcon;
        node.Action = "openObject('1');";
        tree.Add(node);
      }
    }

    When i debug this code none of my breakpoints within this code gets hit, what am i doing wrong?
    Thanks in advance.

  • Bunnynut 129 posts 311 karma points
    Aug 31, 2013 @ 12:27
    Bunnynut
    0

    Could someone please help me with this question? I can't get it to work and find that the available documentation is a bit lacking in this area. Even the video's on the topic are outdated, or am i looking in the wrong area?

     

    Any help will be greatly appreciated.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies