I am having a newsitem object and i need to get the url of the thumbnail image of that particular news item. Here is the code i am using:
public string GetNewsImage(NewsItem item)
string imageUrl = string.Empty;
if (item != null)
var relatedItems = item.GetRelatedItems("Thumbnail");
var thumbNail = relatedItems.FirstOrDefault();
if (thumbNail != null)
LibrariesManager lb = new LibrariesManager();
var image = lb.GetImage(thumbNail.Id);
if (null != image)
imageUrl = image.ItemDefaultUrl;
But i am not getting all the images with the correct path. Some of the images are not getting the right path using this method. What am i doing wrong. PAny help or hint.
Thanks in advance!!