Copied to clipboard

Flag this post as spam?

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


  • Jonas Eriksson 930 posts 1825 karma points
    Jan 07, 2010 @ 08:39
    Jonas Eriksson
    0

    Javascript for adding a node (of a particular type)

    Hi! My creative editors/writers like to have links on the dashboard for adding some common nodes. For example a shortcut for adding a new news node in the news folder.

    Create a news item

    Anyone knows how to do just that?

    Many thanks

    Jonas Eriksson

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Jan 07, 2010 @ 08:52
    Thomas Höhler
    0

    Just create your own aspx and add them as dashboard control. In the aspx you can create nodes programatically.

    hth, Thomas

  • Jukka-Pekka Keisala 75 posts 179 karma points
    Jan 07, 2010 @ 09:47
    Jukka-Pekka Keisala
    0

    Hi Jonas,

    Like Thomas mentioned, you should create your own usercontrol and add it to dashboard.

    Maybe Per's post about Blog 4 umbraco, 2.0.14 Easy blog creation helps you. 

     

  • Jonas Eriksson 930 posts 1825 karma points
    Jan 07, 2010 @ 10:16
    Jonas Eriksson
    0

    Thanks, but I'm not sure that's what I want. I would just like the ui to pop up a new node-dialog, just as if the user right clicks the news-node and clicks Create.

  • Jukka-Pekka Keisala 75 posts 179 karma points
    Jan 07, 2010 @ 17:11
    Jukka-Pekka Keisala
    1

    ok, maybe you want to look /umbraco/js/umbracoDefault.js

    function createNew()

    openModal("create.aspx?nodeID=" + nodeID + "&nodeType=" + nodeType + "&nodeName=" + nodeName + '&rnd=' + returnRandom(), uiKeys['actions_create'], 425, 600);

  • Jonas Eriksson 930 posts 1825 karma points
    Jan 07, 2010 @ 21:06
    Jonas Eriksson
    0

    Totally cool. The code became (on the dashboard)

    <button id="test" onclick="openModal('create.aspx?nodeID=1256&nodeType=content&rnd=12.3', uiKeys['actions_create'], 425, 600);">test</button>
  • Jonas Eriksson 930 posts 1825 karma points
    Jan 07, 2010 @ 21:07
    Jonas Eriksson
    0

    And on a document in the content window:

    <button id="test" onclick="parent.openModal('create.aspx?nodeID=1256&nodeType=content&nodeName=Nyhet&rnd=12.3', parent.uiKeys['actions_create'], 425, 600);">test</button>

    Thanks Jukka-Pekka!

  • 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