Copied to clipboard

Flag this post as spam?

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


  • WD2013 4 posts 24 karma points
    Jul 11, 2013 @ 15:17
    WD2013
    0

    Razor loop does not show all images from media folder?

    Hi,

    A media folder has about 100 images. I'll try to list them but can see only 97 images, some images are missing. I have tried two different loop:

    option 1)

        var mediaFolder = Umbraco.Media(1244);
        foreach (var mediaItem in mediaFolder.Children)
        {
            Response.Write(mediaItem.NiceUrl() + ",");
        }   
       
    option 2)
        var media= Umbraco.TypedMedia(1244);
        var items = media.Children;
        foreach(IPublishedContent i in items) {
            Response.Write(i.NiceUrl());
        }


    I have added a row

    umbraco.library.RefreshContent();

    and restarted both web and application pool (to delete cache). What might be the reason and how to see all files? If I browse the Media folder from /Umbraco/#media admin pages, I can see all images. I'm using Windows 2008 Server,  running Umbraco v6.0.3 (Assembly version: 1.0.4836.20227)

    Thanks for your help!

  • WD2013 4 posts 24 karma points
    Jul 11, 2013 @ 20:45
    WD2013
    0

    Deleting one missing image and uploading it again to the server somehow fixed the problem, all missing images are now visible. Must be some kind of Umbraco error situation while uploading a file?

  • Ian Dawson 24 posts 104 karma points
    May 15, 2014 @ 12:28
    Ian Dawson
    0

    Just come across this post as was having the same problem.

    I think the way to resolve it is to rebuild the Internal Indexer from the Examine management tab (in the Developers section), because (I think) this is from where media queries are made when working with IPublishedContent (someone correct me if I'm wrong)

    Thanks, Ian

Please Sign in or register to post replies

Write your reply to:

Draft