Copied to clipboard

Flag this post as spam?

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


  • bev0 39 posts 59 karma points
    Jan 28, 2010 @ 20:37
    bev0
    0

    access Media section without media picker nor nodeid

    i have look many places and still could not find any sources where people discuss about accessing Umbraco's media section without provide a node id.  if anyone here knows or saw it anywhere please help.

    thanks!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 28, 2010 @ 21:03
    Douglas Robar
    0

    Welcome to umbraco, bev0!

    The media section is accessed with nodeid's. There's not direct file access for the media section.

    You could build your own media system if you needed to have direct file access (as with FTP). But if you're just trying to find a way to get a lot of images and pdfs and other files into the media section quickly I use the ZipUpload project. The Noerd Upload tool is also excellent. Both are in the Projects section of this site.

    cheers,
    doug.

  • bev0 39 posts 59 karma points
    Jan 28, 2010 @ 21:19
    bev0
    0

    hi Douglas,

    i think i mislead you and probably everyone out there a little bit. what i am trying to accomplish is to access the Media section similiar to umbraco.library.GetMedia(@id, 'false')/data [@alias='umbracoFile'] .  i was thinking of create a folder name Movies, then within that folder i will allow admin to add picture/image for movies, then whenever i need any specific image from that folder i would just access it (using something similiar to umbraco.library.GetMedia()) BUT not have to create media picker to link to each image.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 28, 2010 @ 21:36
    Douglas Robar
    0

    Yes, you can do that. That's usually how photo galleries are done, for instance.

    Once you have the 'folder' in your media section you simply reference its id as a hard-coded value or from a single media picker. Then, use the "deep" option of GetMedia to loop through all the images below that folder.

    umbraco.library:GetMedia(@id, true())

    This will return a nodeset you can iterate through.

    cheers,
    doug.

Please Sign in or register to post replies

Write your reply to:

Draft