Copied to clipboard

Flag this post as spam?

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


  • MK 429 posts 906 karma points
    Mar 18, 2012 @ 11:00
    MK
    0

    Default name when creating a tree node

    Hi there,

    Can I give a default name to a node when I create it (i.e. right click on a node tree and choose create button to create a child)?

    I would like to assign a guid name to the node as I will serve me as an invoice number as well.

    Cheers

    mkariti

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Mar 18, 2012 @ 15:11
    Hendy Racher
    0

    Hi Mkariti,

    You can do that with an action handler - Umbraco will still ask you to type in a name, but in the action handler on save you can then update the .Text field to be set to a guid.

    How about adding a label field, and updating that with the guid stamp ?

    HTH,

    Hendy

     

  • MK 429 posts 906 karma points
    Mar 18, 2012 @ 15:23
    MK
    0

    Many thanks Hendy!

    I'm expecting to create about 30 invoices a day so I will want to avoid bits and pieces like naming nodes.

     Also, it will make searching easier.

    Regards,

    mkariti

  • Rodion Novoselov 694 posts 859 karma points
    Mar 19, 2012 @ 04:01
    Rodion Novoselov
    1

    Hi. Perhaps even more convenient solution would be creating a fully custom action that would create a new document with a name and a document type you need in one pop-up menu click, so that to skip typing a name and choosing a document type at all.

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 10:23
    MK
    0

    Many thanks Rodion, 

    I took your edvice and Ive tried to do that - I followed the Video Tutorial in umbraco tv and a few

    written tutorials from the forum but I always got the same result were my Tree nodes wouldn't rendered and it went blank.

    Any idea?

    Cheers

     

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 11:48
    MK
    0

    Update: It seems like the IAction is creating the unwanted behavior.

    Will appriciate if anyone know on how to fix this one.

    mkariti

  • Rodion Novoselov 694 posts 859 karma points
    Mar 19, 2012 @ 12:16
    Rodion Novoselov
    0

    Hi. How do you add the action to the menu? BTW, little time ago I posted here a very small project - you can get the sources to make use of them as of a sample of adding a custom action to the menu. http://our.umbraco.org/projects/backoffice-extensions/republishing-enhancement 

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 12:55
    MK
    0

    Hi Rodion,

    Had a look at your project. It looks the same as this one:

    http://umbraco.com/help-and-support/video-tutorials/developing-with-umbraco/events/add-items-to-the-context-menu/TVPlayer

    I'm still getting the error!

    Also, what is the use of the Letter prop in the IAction?

    I read on the forum that it might conflict with other extension, though it is clearly not my case...

    Regards,

    mkariti

     

  • Rodion Novoselov 694 posts 859 karma points
    Mar 19, 2012 @ 13:17
    Rodion Novoselov
    0

    Hi. The "letter" property is supposed to return some "unique" character value (actually, I'm not completely sure, but it seems that if your action is not a subject to assigning permissions you can return any value that's just not used in Umbraco itself).

    What exact error do you get? Have you got a custom item appearing in the menu or even it doesn't work in your case?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Mar 19, 2012 @ 13:20
    Tom Fulton
    0

    Hi,

    The video and files on umbraco.tv for adding the context menu item are actually for pre-v4.5 and will cause an issue in 4.5+ if you use that code - all your trees will go blank until you remove the DLL.  The fix is easy though, see this thread - and/or check out Rodion's code.  More info about the upgrade here

    HTH,
    Tom

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 13:21
    MK
    0

    Many thanks Tom!

    Im checking it!

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 13:28
    MK
    0

    Work like a charm!

    Many thanks for everyone!

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 14:59
    MK
    0

    Hi Rodion,

    Can you please direct me to how to crete pop-up menu click?

    Is there an umbraco JS model to create such?

    Many thanks

    mkariti

  • Rodion Novoselov 694 posts 859 karma points
    Mar 19, 2012 @ 15:32
    Rodion Novoselov
    0

    Hi. A popup menu bound to an action always calls some javascript code. There're two properties in the IAction iterface that you're supposed to implement: "JsFunctionName" and "JsSource". The latter (JsSource) is optional and should returns an "~/umbraco"-relative path to a *.js file that will be loaded for serving the action. The former one (JsFunctionName) returns some javascript code (not just a function name) that will be executed on the action click. I would also recommend to look into umbraco sources to investigate how different standard actions are implemented - there're a good deal of usefull javascript API that you can find there starting from in-built action implementations.

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 15:43
    MK
    0

    Again, thanks for your quick reply!

    Is this a good practice:

            public string JsSource
            {
                get { return "function CreateQuote(){UmbClientMgr.openModalWindow('http://dev.fnx.co.il/umbraco/dPage.aspx', 'window title', true, 500, 400,0,0,'', '');}"; }
            }

    Also, Is there a specific folder were I can add all my custom pages?

    Many thanks

    mkariti

  • Rodion Novoselov 694 posts 859 karma points
    Mar 19, 2012 @ 16:15
    Rodion Novoselov
    0

    I don't know for sure if it's possible to return raw js code from the JsSource property (I've tried only to return a path to the js file). However, this variation below should work I suppose (if the dPage.aspx is straight in the ~/umbraco folder):

    public string JsFunctionName {
      get {
        return  "UmbClientMgr.openModalWindow('dPage.aspx', 'window title', true, 500, 400,0,0,'', '')";
      }
    }

    public string JsSource {
      get {
        return null;
      }
    }

     

    There's no special place to put custom *.aspx pages in. You can place them anywhere you find convenient, just make sure that it's under one of the "umbracoReservedPath".


     

  • MK 429 posts 906 karma points
    Mar 19, 2012 @ 16:29
    MK
    0

    Great!

    Many thanks! Ive got a lot to do...:D

Please Sign in or register to post replies

Write your reply to:

Draft