I have an idea to make this package even greater. Currently after media items are uploaded the media tree doesn't get refreshed. This can be done easy by adding the following code after the uploading is completed:
BasePage.Current.ClientTools
.SyncTree(Path, true)
.ShowSpeechBubble(BasePage.speechBubbleIcon.save, "Saved", "The media items have been uploaded");
This will sync the tree (you need to get the path of current node) and show a popup the files have been uploaded.
This is actually something I tried to do, but was completely unaware of the power of the ClientTools class... Hopefully I'll update the project in the next couple of days, you'll get due credit :)
I'm trying to call this code in the Media.AfterSave event handler, but I'm getting "object reference not set to an instance of an object" when trying to use umbraco.BasePages.BasePage.Current - is there another way to access 'current' in a media event?
Reload tree after uploading
Hi,
I have an idea to make this package even greater. Currently after media items are uploaded the media tree doesn't get refreshed. This can be done easy by adding the following code after the uploading is completed:
This will sync the tree (you need to get the path of current node) and show a popup the files have been uploaded.
Jeroen
This is actually something I tried to do, but was completely unaware of the power of the ClientTools class...
Hopefully I'll update the project in the next couple of days, you'll get due credit :)
Thanks again, Jeroen!
I didn't know about it either until I started looking at the umbraco 4.5 source code :). Glad I could help a little with this awesome package!
Jeroen
Hi Emanuel,
Any idea when you've got time to add this feature?
Jeroen
Hi Jeroen,
I might have some time tomorrow morning, but no promises...
Emanuel
Hi Emanueal,
If you make me a Contributor for this project I'd be happy to build in this functionality.
Jeroen
Hi Jeroen & Emanuel,
Hope you decide to cooperate on this feature - it's very needed! :)
Best regards,
Hundebol
I'm getting an error about Current not being part of BasePage.
Edit: Never mind. My project was targeting the wrong version of the framework.
Hi Connie
Can you be a bit more specific on what the error says?
/Jan
I'm trying to call this code in the Media.AfterSave event handler, but I'm getting "object reference not set to an instance of an object" when trying to use umbraco.BasePages.BasePage.Current - is there another way to access 'current' in a media event?
BasePage.Current won't work because the code is running under a .ASHX totally outside the Umbraco engine.
is working on a reply...