More in this section
Forums / Designing & Styling / Add simple image to news post

Add simple image to news post

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Amanda Shafer
    Amanda Shafer avatar
    198 posts
    12 Oct 2012
    20 May 2014
    Link to this post

    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.

  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    26 Mar 2015
    22 May 2014
    Link to this post
    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. 

    Ivan D. Dimitrov
    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
2 posts, 0 answered