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?
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,
[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
is working on a reply...