Copied to clipboard

Flag this post as spam?

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


  • Torben Warberg Rohde 35 posts 89 karma points
    Jan 23, 2014 @ 16:25
    Torben Warberg Rohde
    0

    No-nonsense custom sections in Umbraco 7?

    I have followed this tutorial for creating a custom section:

    http://www.enkelmedia.se/blogg/2013/11/22/creating-custom-sections-in-umbraco-7-part-1.aspx

    I now have a "tray" icon that I can click, displaying a root node, which then upon click loads edit.html from the App_Plugins/...etc.../ folder: But since it is a HTML I would need to do some AJAX stuff in order to fetch my data (I assume).

    What I want is just an ASP.NET web forms page, user controls or something, protected by the Umbraco login, and shown inside the Umbraco UI (not necessarily styled the same way).

    This was possible using the old way Tree:

    myTreeNode.Action = string.Format("javascript:openExtraPage('{0}')", "statistics.aspx");

    But that does not seem to work anymore.

    Maybe I'm stuck in the past, but I am not to keen on learning Angular and doing AJAX stuff just to show a bit of stats from a database, or do some simple db-CRUD.

    What would you recommend?

  • Per Ploug 865 posts 3476 karma points MVP admin
    Jan 27, 2014 @ 14:56
    Per Ploug
    0

    If you want to do things the old way, just stick to the old tree api that enables you to do that, Umbraco 7's tree api wraps these and tries to run your custom javascript actions when you click the nodes.

    if you want to use the new api, you can do:

    node.AdditionalData.Add("jsAction", "alert('hey')");
    

    to attach a onClick function on the node

Please Sign in or register to post replies

Write your reply to:

Draft