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)
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?
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)
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!
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?
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
is working on a reply...