How would you got about setting a value to a property on a existing media folder?
I've got the following but does'nt seem to work.
var startMedia = uQuery.GetMediaByName(foldername).FirstOrDefault(); var mediaFolder = startMedia.Id; var d = new umbraco.cms.businesslogic.web.Document(1362); d.getProperty("galleryPassword").Value = password.ToString(); d.Publish(new umbraco.BusinessLogic.User(0)); umbraco.library.UpdateDocumentCache(d.Id);
Media media = Media.MakeNew(name, mediaType, adminUser, parentId); and then media.getProperty("umbracoFile").Value = umbracoFile;
To set the property, but how to you reference an existing media item? if it was a document you would just use Document doc = Document(nodeid); but that does'nt seem to work for an existing media item?
Set a property's value on a media folder thru api
How would you got about setting a value to a property on a existing media folder?
I've got the following but does'nt seem to work.
On this page you can see how I set properties on a media item: http://damp.codeplex.com/SourceControl/changeset/view/62425cfc1854#DAMP.Samples%2fInstaller.ascx.cs. See the CreateMedia method. You shouldn't use the Document object, but the Media object.
Jeroen
Thanks jeroen.
So it's using
To set the property, but how to you reference an existing media item? if it was a document you would just use Document doc = Document(nodeid); but that does'nt seem to work for an existing media item?
Pete
Try something like this
Alternatively, I think this too should work
is working on a reply...