Copied to clipboard

Flag this post as spam?

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


  • Max Edwards 26 posts 50 karma points
    Sep 06, 2010 @ 15:37
    Max Edwards
    0

    Add tab to edit member screen

    Is it possible to add a tab to the edit member screen?

    To extend this screen I can see that I should be able to add a user control to the editMember.aspx but I would prefer to go down the tab route.

    Many thanks

  • Richard 146 posts 168 karma points
    Sep 06, 2010 @ 15:45
    Richard
    0

    Yes. In ./config/Dashboard.config the following will add two tabs call the two different user controls.

    <?xml version="1.0" encoding="utf-8"?>
    <dashBoard>

    ....

     <section>
    <areas>
    <area>member</area>
    </areas>
    <tab caption="Register users">
    <control>/usercontrols/MyClient/dashboard/PersonDetailList.ascx</control>
    </tab>
    <tab caption="Downloads">
    <control>/usercontrols/MyClient/dashboard/PersonDownload.ascx</control>
    </tab>
    </section>

    </dashBoard>
  • Max Edwards 26 posts 50 karma points
    Sep 06, 2010 @ 15:50
    Max Edwards
    0

    Thanks Richard but won't these tabs only show when you click on the members section icon not as additional tabs to the edit member screen?

  • Richard 146 posts 168 karma points
    Sep 06, 2010 @ 16:23
    Richard
    0

    You are correct. Sorry, misread your question.

  • Max Edwards 26 posts 50 karma points
    Sep 06, 2010 @ 17:23
    Max Edwards
    0

    Further to this, adding a user control to the editMember aspx page doesn't work very well at all. The content of the user control is barely visible and no scroll bars are present. If you click on the page and "drag down" you can get to it but this isn't something I want to put in front of a client.

    Can I create something that adds the extra tab on the edit screen as it loads? The editMember page has nothing in the .aspx but a placeholder so I'm guessing the current items are added in code?

    Thanks

  • Max Edwards 26 posts 50 karma points
    Sep 06, 2010 @ 18:58
    Max Edwards
    0

    I have managed to get somewhere with this. I'm not sure it is best practice mind so if you know of a better way speak up!

    I started with this post as a reference: http://our.umbraco.org/forum/developers/extending-umbraco/6675-Umbraco-tabs

    In the /umbraco/members/EditMember.aspx page I added a reference: 

    <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>

     

    I also added the following "Panes" in the content area for body:

                <cc1:Pane ID="Pane1" runat="server" Height="600px" Width="330px">

                    <cc1:PropertyPanel runat="server" ID="pp_sample1">

                        <asp:Literal ID="litsample1" runat="server"></asp:Literal>

                        <asp:Label ID="Label1" runat="server" Text="this is on the first tab"></asp:Label>

                    </cc1:PropertyPanel>

                </cc1:Pane>

                <cc1:Pane ID="Pane2" runat="server" Height="600px" Width="330px">

                    <cc1:PropertyPanel runat="server" ID="pp_sample2">

                        <asp:Literal ID="litsample2" runat="server"></asp:Literal>

                        <asp:Label ID="Label2" runat="server" Text="this is on the second tab"></asp:Label>          

                    </cc1:PropertyPanel>

              </cc1:Pane>

     

    Then finally added a script tag to hook up my new "Panes" to the existing TabView when the page loads:

        <script runat="server">
    
                protected void Page_Load(object sender, EventArgs e)
                {
                    base.Page_Load(sender, e);
    
                    TabView tabview = (TabView)Page.Controls[0].FindControl("body").FindControl("TabView1");
    
                    TabPage FirstTab = tabview.NewTabPage("First");
    
                    FirstTab.Controls.Add(Pane1);
    
                    TabPage SecondTab = tabview.NewTabPage("Second");
    
                    SecondTab.Controls.Add(Pane2);
    
                }
    
        </script>

    I'm wondering if there would be another way to hook into this page using an external class so that I wouldn't need to modify EditMember.aspx but for now this works for me and is a much better solution than just adding a usercontrol to the .aspx page. This was done in Umbraco V4.

    Max

  • Ian Robinson 79 posts 143 karma points
    Nov 16, 2011 @ 11:11
    Ian Robinson
    0

    Hi,

    I came across this post when investigating how to do the same thing as Max, but I came up with a different solution.

    My Umbraco site is an intranet solution sitting on a client's Active Directory network.  Not all AD users are automatically added to the members section of Umbraco though, only a subset and for this subset of users I needed to show their AD details from the member section of umbraco.

    From the Umbraco back office, I selected the member type that my members would be (in my case "Active Directory Member") and created a tab called "Active Directory Profile".

    Then I created my own Umbraco data type in .Net, that found the member's details in the AD and displayed them.  All I then had to do was add this data type to the tab control I had created in the member type.  Now, when a user selects the member in Umbraco they will see the Active Directory Member tab showing the user's details from the AD.

    This solution means I don't have to change the EditMember.aspx page, or any Umbraco source code, making it more "pluggable" and less likely to fail if I ever upgrade.

    I hope this solution is useful to someone else, or even to Max if he's still monitoring this post?

Please Sign in or register to post replies

Write your reply to:

Draft