Copied to clipboard

Flag this post as spam?

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


  • Ian Robinson 79 posts 143 karma points
    Dec 05, 2013 @ 18:29
    Ian Robinson
    0

    Members section context menu item

    Hi,

    In Umbraco 6.0.5, I need to add an item to the context menu when a user right-clicks on a member, e.g. in the Members section --> Members --> Members --> a.

    I can add items to the context menu of a node in the Content section and to a node in the Members section in the member group (i.e. NodeType.Equals("membersGroup"), but NOT to a member node in the members group, letter sections, i.e. a, b, c etc.

    The method "BaseTree_BeforeNodeRender" never seems to fire and if it did, I'm not sure what node type to check for.  Am I missing something?

    public class MemberCustomTreeEvents: ApplicationBase
        {
            public MemberCustomTreeEvents()
            {
                BaseTree.BeforeNodeRender += new BaseTree.BeforeNodeRenderEventHandler(BaseTree_BeforeNodeRender);
            }
            void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
            {
                if (node.NodeType.Equals("members", StringComparison.OrdinalIgnoreCase))
                {
                    node.Menu.Insert(0, new SendEmailValidationRequest());
                    node.Menu.Insert(1, umbraco.BusinessLogic.Actions.ContextMenuSeperator.Instance);
                }
            }
        }
Please Sign in or register to post replies

Write your reply to:

Draft