Copied to clipboard

Flag this post as spam?

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


  • Kevon K. Hayes 255 posts 281 karma points
    Nov 22, 2010 @ 01:18
    Kevon K. Hayes
    0

    Attempting to add a new Context Menu Item

    Umb Experts,

    In an attempt to add a new item to the context menu the following code seems to cause no items to render at all. The entire tree wont render now... also no errors.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using umbraco.BusinessLogic;
    using umbraco.presentation.masterpages;
    using umbraco.uicontrols;
    using umbraco.interfaces;

    namespace MailAction
    {
        public class MailAction:ApplicationBase
        {
            public MailAction() {
                umbraco.cms.presentation.Trees.BaseTree.BeforeNodeRender += new umbraco.cms.presentation.Trees.BaseTree.BeforeNodeRenderEventHandler(BaseTree_BeforeNodeRender);
            }

            void  BaseTree_BeforeNodeRender(ref umbraco.cms.presentation.Trees.XmlTree sender, ref umbraco.cms.presentation.Trees.XmlTreeNode node, EventArgs e)
            {
                node.Menu.Insert(0, new MailActionItem());
                node.Menu.Insert(1, umbraco.BusinessLogic.Actions.ContextMenuSeperator.Instance);
            }

        }

        public class MailActionItem : umbraco.interfaces.IAction
        {
            #region IAction Members
            private string _alias = "Mail";
            public string Alias
            {
                get { return _alias; }
            }

            public bool CanBePermissionAssigned
            {
                get { return true; }
            }

            public string Icon
            {
                get { return "mail.png"; }
            }

            public string JsFunctionName
            {
                get
                {
                    return "alert('Umbraco hearts you');";
                }
            }

            public string JsSource
            {
                get { return ""; }
            }

            public char Letter
            {
                get { return 'ยจ'; }
            }

            public bool ShowInNotifier
            {
                get { return false; }
            }

            #endregion
        }

    }

     

  • Grigoriy Lev 8 posts 28 karma points
    Aug 01, 2011 @ 11:40
    Grigoriy Lev
    0

    +1 The Same thing! Somebody Help!

  • Grigoriy Lev 8 posts 28 karma points
    Aug 01, 2011 @ 13:10
    Grigoriy Lev
    0

    When Alias is empty - tree comes back.....

    Without menu of course

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Aug 01, 2011 @ 14:06
  • Grigoriy Lev 8 posts 28 karma points
    Aug 01, 2011 @ 14:56
    Grigoriy Lev
    0

    Thank you very much!

  • Kevon K. Hayes 255 posts 281 karma points
    Aug 04, 2011 @ 04:53
    Kevon K. Hayes
    0

    Your solution caused the content and media trees to come back but the XSLT treenode wont render.

  • mercy 1 post 21 karma points
    Aug 04, 2011 @ 07:50
    mercy
    0

    Hello 
    It is my pleasure to contact you after going through your profile on my search for friendship on (www.umbraco.org)
    My name is Mercy and I'm interested in knowing you and being friendly with you
    please send your e-mail to my address ([email protected])
    so that i will send my picture to you
     Yours in love,
         Mercy

Please Sign in or register to post replies

Write your reply to:

Draft