More in this section

Forums / Developing with Sitefinity / newsItem.ThumbnailUrl.ToString()?

newsItem.ThumbnailUrl.ToString()?

2 posts, 0 answered
  1. Bloommedia
    Bloommedia avatar
    10 posts
    Registered:
    18 May 2009
    17 Sep 2009
    Link to this post
    Telerik.News.NewsManager newsManager = new Telerik.News.NewsManager("News");  

            IList listOfNewsItems = newsManager.Content.GetContent("[CategoryName] ASC");

            if (listOfNewsItems.Count > 0)

            {

                foreach (Telerik.Cms.Engine.IContent newsItem in listOfNewsItems)

                {

                    Response.Write(newsItem.GetMetaData("Title") + "<br />");

                    Response.Write(newsItem.Content.ToString() + "<br /><br />");

                    Response.Write(newsItem.ThumbnailUrl.ToString() + "<br /><br />");

                }

            }

    "/09-09-17/News_Title_1.tmb.ashx" is returned as the new thumbnail? When it it is names news-thumb1.jpg?

    Any ideas?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Sep 2009
    Link to this post
    Hi Bloommedia,

    ThumbnailUrl property can be used only with IContent items from Images and Documents module. It cannot be used for News content Items. The property is defined under IContent interface and this is the reason why you see it. The News module supports "Thumbnail" metakey which can be accessed by GetMetaData method.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered