Copied to clipboard

Flag this post as spam?

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


  • Chris McVittie 103 posts 75 karma points
    Aug 08, 2009 @ 17:26
    Chris McVittie
    0

    Listing data from media sections

    Hi, 

    This is probably a "best practice" type question.  

    My requirement is to create various media items with meta data - e.g. for a podcast, with descriptions, dates, people.  

    I know I can use xslt to list all media items in a media folder, and hold extra properties against the media - which covers my requirement, however, as I understand it, using the library functions for the media section do involve database hits rather than hitting the xml cache.

    If I have a page with say 20 items on it, or I want to have a "top 5 podcasts" macro, does this mean that each page will have N database hits where N is the number of items?

    I was thinking I could use events like MediaType.New to create a document of a certain type in my document tree which all my macros would reference.  It does seem like a bit of hassle though, and is a bit confusing for users to upload a media item and then to have to go somewhere else to be able to add the meta data.  

    I forgot to mention that I do want "Bulk Upload" functionality, and plan to use the excellent Noerd uploader to achieve this, hence a Media picker with Upload wouldn't quite solve it.

    Anyway, I look forward to hearing what other people are doing for this type of problem.

    Thanks,

    Chris

  • Chris Koiak 700 posts 2626 karma points
    Aug 08, 2009 @ 17:38
    Chris Koiak
    0

    Hi Chris McV,

    This post has a very similar discussion to your requirements http://our.umbraco.org/forum/developers/api-questions/3249-public-document-archive.

    I'd stand by what I said in this post, and suggest you upload the documents to the content section (rather than the media section). This is a lot easier to work with, listing files etc. I've used this approach inthe past and it's worked well for me.

    If you create the same properties for a conent node as that of a media node (i.e ) then the size and type will still be auto populated as per the media section. You would then use the a content picker to select the files/documents (maybe try http://treemultipicker.codeplex.com/)

    However if you don't fancy this approach remember you can add metadata properties to a media type just like you can a content type. There's just a lot more inefficent to list.

    I've never used Noerd uploader so can't comment on this one.

    Cheers,

    Chris K

  • Chris Koiak 700 posts 2626 karma points
    Aug 08, 2009 @ 17:42
    Chris Koiak
    0

    "(i.e )" above should have been

    (i.e. umbracoFile, umbracoWidth, umbracoHeight, umbracoBytes, umbracoExtension)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 08, 2009 @ 19:58
    Dirk De Grave
    0

    Hi,

     

    Adding some extra thoughts on performance. If you're using macro's, consider adding some caching to speed up rendering at next page requests. Of course, it all depends on the requirements of the system, but if you can live with a 'top 5' list that doesn't change frequently (say, once a day), adding caching may help speed up performance. 

    Caching will help in both solutions (either uploading to media section or using content section to list your files)

    Cheers,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft