+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / thumbnail to events

thumbnail to events

7 posts, 0 answered
  1. NuToSitefinity
    NuToSitefinity avatar
    140 posts
    Registered:
    01 Sep 2010
    01 Apr 2011
    Link to this post
    I added the thumbnail upload feature to my event modules. I added under the metafield section in the web config file, and pretty much copied the html, references, etc I needed from the news ascx file, however, when I drag the events widget to my page, I do not see the thumbnail next to the event I added it to. I can see the thumbnail information in the table for this event, but I can't see the actual image on my page. How can I get the image to appear on my event widget?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Apr 2011
    Link to this post
    Hi NuToSitefinity,

    You should create a custom class that inherits from EventsView and override SetItemMetadata. There you need to inject/resolve the value you set using the backend UI

    foreach (IMetaInfo info in Manager.MetaKeys.Values)
     {
         Control ctrl = base.FindContentViewControl(info.Key, itemContainer);
         if ( (ctrl != null)
              && (ctrl is System.Web.UI.WebControls.Image)
              && (info.ValueType == MetaValueTypes.ShortText))
         {
             string imageUrl = (string)contentItem.GetMetaData(info.Key);
             if (!String.IsNullOrEmpty(imageUrl))
             {
                 ((System.Web.UI.WebControls.Image)ctrl).ImageUrl = this.GetItemUrl(imageUrl, false);
             }
     
    }


    Kind regards,
    Ivan Dimitrov
    the Telerik team

  3. NuToSitefinity
    NuToSitefinity avatar
    140 posts
    Registered:
    01 Sep 2010
    06 Apr 2011
    Link to this post
    I'm able to upload it, however, how do I pull down the thumbnail from the table? 
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Apr 2011
    Link to this post
    Hi NuToSitefinity,

    Use GetMetaData method of the content item. I believe that you store the image/thumb guid or some path to it.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

  5. NuToSitefinity
    NuToSitefinity avatar
    140 posts
    Registered:
    01 Sep 2010
    06 Apr 2011
    Link to this post
    I see that its being stored in the database as [library]#####-####-####-## and so on, since I had to create a query to meet my needs to for my custom events page, how can I get the actual image linked to that GUID that is stored in the table?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Apr 2011
    Link to this post
    Hi NuToSitefinity,

    Check this post

    http://www.sitefinity.com/blogs/georgichokov/posts/09-07-02/resolving_the_url_of_dynamic_links.aspx

    All the best,
    Ivan Dimitrov
    the Telerik team

  7. NuToSitefinity
    NuToSitefinity avatar
    140 posts
    Registered:
    01 Sep 2010
    06 Apr 2011
    Link to this post
    would that work on my datalist databound method?
Register for webinar
7 posts, 0 answered