Can anyone tell me what I'm doing wrong? There's also a property type called "Image", should I be using that instead? e.g. gImage.Image = "~/umbraco/images/thumbnails/docWithImage.png";
Those are the correct properties, but I think you only need to store the image name ie "mediaPhoto.gif" or "docWithImage.png", umbraco adds the path information automatically.
Setting media types icon and thumbnail
Hi,
I'm creating new media type from a .net user control but I can't seem to set the media type's icon or thumbnail:
MediaType gImage = MediaType.MakeNew(umbraco.BusinessLogic.User.GetCurrent(), "Bespoke Image");
gImage.IconUrl = "~/umbraco/images/umbraco/mediaPhoto.gif";
gImage.Thumbnail = "~/umbraco/images/thumbnails/docWithImage.png";
gImage.Save();
Can anyone tell me what I'm doing wrong? There's also a property type called "Image", should I be using that instead? e.g. gImage.Image = "~/umbraco/images/thumbnails/docWithImage.png";
Hi Ian,
Those are the correct properties, but I think you only need to store the image name ie "mediaPhoto.gif" or "docWithImage.png", umbraco adds the path information automatically.
HTH,
Tom
Thanks Tom, you were right. I removed the paths and left only the filenames and it worked.
I still don't know what the .Image property is for, but setting the IconUrl and Thumbnail is what I needed, so thank you!
is working on a reply...