Copied to clipboard

Flag this post as spam?

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


  • saji 83 posts 38 karma points
    Jun 27, 2012 @ 13:00
    saji
    0

    Custom section showing same node twice

    I added a custom section in umbraco admin side and its showing the node twice.

     

    Here is my assembly code:

     

     

    namespace MyCustomAssemblyGallery

    {

        /// <summary>

        /// Summary description for GalleryHandlers

        /// </summary>

        public class GalleryHandlers : BaseTree

        {

            public GalleryHandlers(string application)

                : base(application)

            { }

     

            protected override void CreateRootNode(ref XmlTreeNode rootNode)

            {

                rootNode.Icon = FolderIcon;

                rootNode.OpenIcon = FolderIconOpen;

                rootNode.NodeType = "init" + TreeAlias;

                rootNode.NodeID = "init";

            }

     

            public override void Render(ref XmlTree Tree)

            {

                // Create tree node to allow viewing previously sent newsletters

                var GalCat = XmlTreeNode.Create(this);

                GalCat.NodeID = "uniqueMngCat";

                GalCat.Text = "Manage Category";

                GalCat.Icon = "docPic.gif";

                GalCat.Action = "javascript:openGalleryCategory()";

                GalCat.Menu = null;

                // Add the node to the tree

                Tree.Add(GalCat);

     

     

                // Create tree node to allow viewing previously sent newsletters

                var GalAlbum = XmlTreeNode.Create(this);

                GalAlbum.NodeID = "uniqueMngAlbums";

                GalAlbum.Text = "Manage Albums";

                GalAlbum.Icon = "docPic.gif";

                GalAlbum.Action = "javascript:openGalleryAlbums()";

                GalAlbum.Menu = null;

                // Add the node to the tree

                Tree.Add(GalAlbum);

     

                // Create tree node to allow viewing previously sent newsletters

                var GalPhoto = XmlTreeNode.Create(this);

                GalPhoto.NodeID = "uniqueMngPhotos";

                GalPhoto.Text = "Manage Photos";

                GalPhoto.Icon = "docPic.gif";

                GalPhoto.Action = "javascript:openGalleryPhotos()";

                GalPhoto.Menu = null;

                // Add the node to the tree

                Tree.Add(GalPhoto);

            }

     

            public override void RenderJS(ref StringBuilder Javascript)

            {

                Javascript.Append(@"

                    function openGalleryCategory() {

                        parent.right.document.location.href = 'gallery/Category-list.aspx';

                    }

    ");

     

     

                Javascript.Append(@"

                    function openGalleryAlbums() {

                        parent.right.document.location.href = 'gallery/Gallery-list.aspx';

                    }

    ");

     

                Javascript.Append(@"

                    function openGalleryPhotos() {

                        parent.right.document.location.href = 'gallery/GalleryPhotos-list.aspx';

                    }

    ");

     

            }

     

        }

    }

Please Sign in or register to post replies

Write your reply to:

Draft