Copied to clipboard

Flag this post as spam?

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


  • Jason Evans 50 posts 71 karma points
    Oct 16, 2012 @ 12:02
    Jason Evans
    0

    How can I open a page in the dashboard from click on content tree node?

    I have an Umbraco site where the following requirement has been set:

    In the "Members" area there are three content tree nodes:

    • Members
    • Member Groups
    • Member Types

    When clicking on any of the above nodes, the default behaviour is:

    javascript.UmbClientMgr.appActions().openDashboard('member');

    What I would like to do is this - when the user clicks on the "Member Groups" node, rather then opening the "member" dashboard, I want to show a new custom dashboard instead. I have tried editing the "dashboard.config" file by adding this:

    <section alias="StartupMemberGroupDashboardSection">
        <areas>
          <area>memberGroup</area>
        </areas>
        <tab caption="Get Started">
          <control showOnce="true" addPanel="true" panelCaption="">
            /umbraco/plugins/mystuf/test.ascx
          </control>
        </tab>
      </section>

    I then have a custom "LoadMemberGroups" class (which takes over from Umbraco's default "loadMemberGroups" class) which, in "CreateRootNode(ref XmlTreeNode rootNode)" I set the "Action" property of the node to:

    rootNode.Action = string.Format("javascript:{0}", ClientTools.Scripts.OpenDashboard("memberGroup"));

    Now when clicking on the "Member Groups" node a blank, empty, dashboard window is shown. Looking in the Umbraco code I can see the problem is that it's expecting an "app" name of memberGroup somehwere, but there isn't one. There is a "member" app, but "memberGroup" is associated to that "member" app, so I can't create a seperate "memberGroup" app entry in umbracoAppTree. I did try this, but ended up with the "Member Groups" content node not rendering at all.

    I then tried:

    rootNode.Action = string.Format("javascript:{0}", ClientTools.Scripts.ChangeContentFrameUrl("/plugins/mystuff/test.aspx"));

    But the problem here is that I loose the dashboard template look - rather, the entire right hand side shows the "test.aspx" page, which isn't what I want.

    So how can I change the content of the dashboard area via clicking on a content tree node?

     

  • Jason Evans 50 posts 71 karma points
    Oct 16, 2012 @ 13:07
    Jason Evans
    0

    OK, I got what I wanted, but I did cheat a bit.

    Basically when I click on the "Member Groups" node, I do the following:

    rootNode.Action = "parent.right.document.location.href = '/umbraco/plugins/mystuff/test.aspx'";

    The page "test.aspx" contains controls borrowed from "dashboard.aspx" from the Umbraco source code. So I've got the page looking similar to a dashboard, but it will have my custom functionality.

  • 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