Copied to clipboard

Flag this post as spam?

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


  • Greyhound 102 posts 124 karma points
    May 23, 2011 @ 13:28
    Greyhound
    0

    Images in Media Folder

    Hi,

    I've already posted something similar but cannot get any help. Having redesigned my approach can anyone help with the following:

    1. I have a media folder as follows:

    >>Gallery
    >>Events
    >>Centrepieces

    I have thumbnail images in Centrepieces name 1_thumb.jpg, 2_thumb.jpg etc etc
    I have also added full sized images which follow the convention 1.jpg, 2.jpg etc etc

    Using razor, I have managed to get the thumnails listed by filtering on the "_thumb.jpg" part of the file name. During the folder iteration, I need to get the corresponding full sized image name. Looking at the images, I can see that each of them have a seperate folder so I cannot collect the img location of the full sized image.

    Is it possible to loop through the contents of a media folder by using its name?

    Cheers,

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    May 23, 2011 @ 19:02
    Bo Damgaard Mortensen
    0

    [Edited]

    Greyhound,

    You should check out uComponents to work with Media item from Razor :-)

    Can be found here: http://our.umbraco.org/projects/backoffice-extensions/ucomponents

    When the package is installed, you can use it in Razor:

    @using umbraco.cms.businesslogic.media;
    @using uComponents.Core;
    @using uComponents.Core.uQueryExtensions;

    Perhaps the uQuery method "GetMediaByName()" would be interesting in your case? You can read the documentation here: http://ucomponents.codeplex.com/wikipage?title=uQuery

    - Bo

Please Sign in or register to post replies

Write your reply to:

Draft