tuanvt / EPiImage-7.1

EPiImage custom property for EPiServer 7.1
4 stars 5 forks source link

Images are not visible in browser after the project is build. #2

Open raskolnikoov opened 10 years ago

raskolnikoov commented 10 years ago

I've noticed that all images in a list (EPiImageGalleryImageCollection) are empty after a project is build. But they are still visible in the EPiServer editor. If the page is re-published the images show up correctly on the site.

Any idea?

raskolnikoov commented 10 years ago

I've build my own fix for this:

//Fixes images not rendering after solution build public static EPiImageGalleryImageCollection GetImageList(PageReference pageLink, string property) { try { var page = EPiServer.DataFactory.Instance.GetPage(pageLink); EPiImageGalleryProperty galleryProperty = page.Property[property] as EPiImageGalleryProperty; return galleryProperty == null ? null : galleryProperty.ConvertXhtmLtoImageCollection(galleryProperty.XhtmlString.ToString()); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }

tuanvt commented 10 years ago

Thanks, great find. I will update the code with your fixes, appreciate it