More in this section

Forums / Developing with Sitefinity / Adding thumbnails to contentitems

Adding thumbnails to contentitems

4 posts, 0 answered
  1. John Heins
    John  Heins avatar
    7 posts
    Registered:
    02 Sep 2009
    28 Sep 2009
    Link to this post

    I am programming against the NewsManager API and I have to add a thumbnail to my newsitem (IContent object), which contains 'Thumnails' and 'ThumbnailUrl' properties.

    How can I add a thumbnail to my ContentItem?

    Kind regards,

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 Sep 2009
    Link to this post
    Hi John Heins,

    You can add thumbnails only to Image content Items. For News Items you should use GetMetaData or SetMetaData methods where "Thumbnail" is a metakey.

    I hope this helps.

    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.
  3. John Heins
    John  Heins avatar
    7 posts
    Registered:
    02 Sep 2009
    28 Sep 2009
    Link to this post
    Hi Ivan,

    Thanks you for your quick response!

    Yes, this helps, we also use this method to set the title and category. In case of a thumbnail, do we have to use the path to the image on the filesystem or binary data?

    Kind regards.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    28 Sep 2009
    Link to this post
    Hello John Heins,

    It depends on where the data is stored.

    If this is an image from Sitefinity Image Gallery you could use [provide]Guid - [Libraries]29ac180f-e615-4b43-9835-b003a5f11f46

    If you use an item uploaded to a directory in your project you could pass the relative path (~/Images/menu.jpg).

    The better option is storing the items to Sitefinity Image Gallery and passing the [Provider]Guid value. This will ensure that renaming the image will not break any links.

    Kind regards,
    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.
Register for webinar
4 posts, 0 answered