Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I noticed that there is no option for including media or media types in the package creator. Is there any way to do this? Package actions maybe?
We've always treated Media as external content in our packages...there are some work items in CodePlex related to this if you'd like to help vote them up.
Have a look at the CWS package for a good example of using Media as external content.
I can understand treating the media itself as external content and adding it to the package in the files section. However, will it be available in the Media section post install? I assume that it won't.
I just find it odd that there is no way to add Media Types and Member Types to a package the same way you add Document Types. That is kind of limiting.
Agree, adding media types to a package would be great!
@Ricky: would you be so kind to add this as a feature on Codeplex, I'll certainly vote for it!
Hiya guys,I have voted for this recently, but is there a way to resolve this with a package action or a post install usercontrol at all?
Adding media items to a package would also be very helpful, a website package of mine has come to a standstill as I don't want to have to put all the example pictures in the content section. what to do in these situations?
I've looked at the source code of Umbraco and you should be able to programmatically add a media type. You could do this on a post install user control I think. Here is some sample code:
MediaType m = MediaType.MakeNew(adminUser, "Custom Media type");
int tabId = m.AddVirtualTab("test tab");
m.AddPropertyType(new datatype.DataTypeDefinition(1087), "testProperty", "Test property");
m.SetTabOnPropertyType(new property.Property(100), tabId);
The only problem is in the last line you need the id of the property you added, but m.AddPropertyType doesn't return anything. Maybe that should be a codeplex issue.
I think Jeroen's solution is pretty much the solution, though in response to the issue raised, you can get a refference to the property type by alias:
so the last line becomes
PS A good example of adding a media type at package install can be found in the source of Noerds Multiple File Upload package
Any progress on this? any plugins that add media types to a package? Can't understand why this isn't added to Umbraco!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted