Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Ricky Beard 61 posts 116 karma points
    Sep 11, 2009 @ 18:31
    Ricky Beard

    Including Media Types in Package

    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?

  • Paul Sterling 718 posts 1534 karma points MVP 8x admin c-trib
    Sep 11, 2009 @ 19:06
    Paul Sterling

    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.


  • Ricky Beard 61 posts 116 karma points
    Sep 11, 2009 @ 19:45
    Ricky Beard

    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.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 11, 2009 @ 20:41
    Dirk De Grave

    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!




  • Ricky Beard 61 posts 116 karma points
    Sep 11, 2009 @ 22:06
  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Oct 25, 2010 @ 20:28
    Warren Buckley

    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?


  • wolulcmit 357 posts 693 karma points
    Oct 25, 2010 @ 22:41

    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?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Oct 26, 2010 @ 09:51
    Jeroen Breuer


    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.



  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 26, 2010 @ 10:07
    Matt Brailsford

    Hi Warren,

    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

    m.SetTabOnPropertyType(m.getPropertyType("textProperty"), tabId);


  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 26, 2010 @ 10:10
    Matt Brailsford

    PS A good example of adding a media type at package install can be found in the source of Noerds Multiple File Upload package


  • Edwin van Koppen 156 posts 270 karma points
    Mar 11, 2015 @ 09:22
    Edwin van Koppen

    Any progress on this? any plugins that add media types to a package? Can't understand why this isn't added to Umbraco!

Please Sign in or register to post replies

Write your reply to: