Add simple image to news post

Posted by Community Admin on 05-Aug-2018 14:46

Add simple image to news post

All Replies

Posted by Community Admin on 20-May-2014 00:00

I feel like I'm missing something very simple here. I just want to add an image to my news template. If I use the insert code to the right of the template, I get the whole sf:Imagesview control. This creates a header and lost of extra code that I don't need. I just want the image associated with the news item.

 I tried:
<asp:Image ID="test" Url="<%# Eval('Image')%>" runat="server" />

But I get an "error parsing template" message.

Posted by Community Admin on 22-May-2014 00:00

Hello Amanda,

Thank you for contacting us.

The behavior you are noticing is normal. This is due to the fact that the default news item list template uses Telerik's RadTreeView control which does not have an <asp> tag available in its implementation. I am afraid you need to use the ImagesView inside your ItemTemplate tag in order to get the custom related media field on your template. This is done with the intention of improving your performance as this way the item does not need to be queried every time the control loads.

If the markup you get is not to your liking you can always bind your news items to a custom widget and/or repeater and show the news' properties there.

I hope this information is useful. Feel free to get back to us if further information is needed. 

Regards,
Ivan D. Dimitrov
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed