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

Posted by Community Admin on 04-Aug-2018 20:49

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

All Replies

Posted by Community Admin on 11-Feb-2013 00:00

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

Posted by Community Admin on 12-Feb-2013 00:00

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()) %>' />

This thread is closed