Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 583 posts 1407 karma points
    May 10, 2011 @ 22:31
    Sebastian Dammark
    0

    Looping through the content of a folder ?

    Is it possible the get the content of a media folder like with GetMedia(folderid, 1) ?

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    May 10, 2011 @ 23:13
    Jeroen Breuer
    1

    Hello Sebastiaan,

    If you select a media item only that media item is stored in the umbraco.config xml (so recursive is false). If you want to get the content of a media folder you could just select a folder in DAMP and use GetMedia on that folder. In the prevalues you can choose to only store the id so that's what I would do. Only store the id of the folder and get the content of that folder with GetMedia.

    Jeroen

  • Dorothy 9 posts 29 karma points
    Sep 01, 2011 @ 09:19
    Dorothy
    0

    Hi,

    I was not able to display contents of the folder with GetMedia, it returned nothing. Can you please provide Razor sample to display contents of the folder?

    Dorothy

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Sep 01, 2011 @ 13:37
    Jeroen Breuer
    0

    You don't need to use GetMedia anymore if you store the media as full xml. Here is a simple Razor sample:

    <ul class="photoalbum">
    
        @*Loop through all the selected photo album images from DAMP.*@
        @foreach (dynamic d in Model.photos)
        {   
            <li>
                <a href="@d.Image.umbracoFile" rel="gallery">
                    <img src="@d.Image.umbracoFile" width="190" height="190" align="left" border="0" class="styled" />
                </a>
            </li>
        }
    
    </ul>

    Jeroen

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies