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 ?
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.
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?
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
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.
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".
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
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
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
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.
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
Update: It seems like the IAction is creating the unwanted behavior.
Will appriciate if anyone know on how to fix this one.
mkariti
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
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
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?
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
Many thanks Tom!
Im checking it!
Work like a charm!
Many thanks for everyone!
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
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.
Again, thanks for your quick reply!
Is this a good practice:
Also, Is there a specific folder were I can add all my custom pages?
Many thanks
mkariti
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):
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".
Great!
Many thanks! Ive got a lot to do...:D
is working on a reply...