More in this section

Forums / Developing with Sitefinity / News Widget Template - Eval(image) brings back a thumbnail version

News Widget Template - Eval(image) brings back a thumbnail version

2 posts, 1 answered
  1. Brandon
    Brandon avatar
    19 posts
    Registered:
    16 Jan 2013
    11 Feb 2013
    Link to this post

    Hello,

    I am in Sitefinity 5.2, and I have a "News - list" widget template where I'm trying to display a large "title image".

    I'm currently trying to display that in this fashion:

    <img src='<%# Eval("TitleImage")%>' />

    And it works... except that the final HTML rendered has the filename ending in ".tmb" which apparently puts the image in "thumbnail" mode because it displays at about half the size of the image that was uploaded to the image library.

    The custom news property I added is named "TitleImage", and in the widget editing screen, that field is the only one available that uses the "TitleImage" name.

    Here's the URL that the Eval() is putting out to the page:

    /images/default-source/-default-images-/ftr-survey-2013.png.tmb?sfvrsn=2

    And from the image library, I've seen that the actual URL (non-thumbnailed) should actually be:

    /images/default-source/-default-images-/ftr-survey-2013.png?sfvrsn=2

    So you can see the ".png.tmb" versus the ".png" that I really want.

    How can I force my widget template to return the full-size image?

    Thanks,
    Brandon

  2. Brandon
    Brandon avatar
    19 posts
    Registered:
    16 Jan 2013
    12 Feb 2013
    Link to this post

    We've been unable to find a "clean" way to achieve this...the admin area uploader seems to be what applies the ".tmb" thumbnail handler...

    But, we were able find a workaround from a friend of ours who also develops with Sitefinity:

    <asp:Image runat="server" src='<%# Eval("TitleImage").ToString().LastIndexOf(".tmb") >= 0 ? Eval("TitleImage").ToString().Remove(Eval("TitleImage").ToString().LastIndexOf(".tmb")) : Eval("TitleImage").ToString() %>' Visible='<%# !String.IsNullOrWhiteSpace(Eval("TitleImage").ToString()) %>' />

    Answered
2 posts, 1 answered