Images in lists are not displaying on front end of website - General Discussions - General Discussions - Progress Community
 General Discussions

Images in lists are not displaying on front end of website

  • Images in lists are not displaying on front end of website
  • When I add an image to a list item with either the upload or the select from already upload options it displays correctly in the cms but not on the font end of the website.

    On the front end it is outputting this:

    <img src="[images]50ee7335-3914-4708-a4e2-65dbf0c0b0ad" alt="Walter Johnson" style="float: left; margin-right: 10px; margin-bottom: 10px;">

    But it displays correctly when editing the list item on the back end:

    <img src="/images/content-images/walter-johnson.jpg" alt="Walter Johnson" style="float: left; margin-right: 10px; margin-bottom: 10px;" sfref="[images]50ee7335-3914-4708-a4e2-65dbf0c0b0ad" />

    I am using Build 4.2.1733
  • Are you displaying the list content through a custom control?  If so, try this (it will return a string with the correct image src attributes):

    LinkParser.ResolveLinks(listItem.Content, DynamicLinksParser.GetContentUrl, null, false);
  • Hm.  I just found the same behavior on my site (4.2sp1).  It looks like this is a bug in the list widgets.
  • No I am just using the standard list controls.
  • Here's my work around.  Hope you can use it too:

    1. Create a custom template for your widget (mine is in ~/CustomControls/ExpandableList.ascx).  Copy the markup from the existing List Template you're using.

    2. use this code in the code-behind:
    protected void Page_Load(object sender, EventArgs e)
            
                listsControl.ItemDataBound += new EventHandler<Telerik.Web.UI.RadListViewItemEventArgs>(listsControl_ItemDataBound);
            
     
            void listsControl_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
            
                if (e.Item.ItemType == RadListViewItemType.AlternatingItem || e.Item.ItemType == RadListViewItemType.DataItem)
                
                    var listsItemsControl = e.Item.FindControl("listItemsControl") as RadListView;
                    listsItemsControl.ItemDataBound += new EventHandler<RadListViewItemEventArgs>(listsItemsControl_ItemDataBound);
                
     
            
     
            void listsItemsControl_ItemDataBound(object sender, RadListViewItemEventArgs e)
            
                if (e.Item.ItemType == RadListViewItemType.AlternatingItem || e.Item.ItemType == RadListViewItemType.DataItem)
                
                    var lit2 = e.Item.FindControl("Literal2") as Literal;
                    var listItem = ((RadListViewDataItem) e.Item).DataItem as Telerik.Sitefinity.Lists.Model.ListItem;
                    lit2.Text = LinkParser.ResolveLinks(listItem.Content, DynamicLinksParser.GetContentUrl, null, false);
                
            

    That will put the listItem content through the link parser.

    3. Go to the page with the widget, Edit the Widget properties
    4. Delete the value for MasterTemplateId
    5. Enter the path to your new control in LayoutTemplatePath (~/CustomControls/ExpandablePath.ascx)


    Craig
  • Thanks, I will give that a try.
  • 308549_303318-Telerik-Sitefinity-Model.zip
    Hello Matt,

    Thank you for contacting Telerik support.

    It is quite possible that the issue comes from a bug which was fixed in 4.2. SP1 (Page links are not resolved properly when a project is accessible from two different domains, and of them is a sub-directory of the other &ndash; PITS).
    I'm sending you a patched Telerik.Sitefinity.Model.dll, which should solve the problem. You need to replace the same file in your ~/bin folder. The fix will be also included in the next release. Sorry for the inconvenience.

    Let me know if you have any further questions.


    Regards,
    Jen Peleva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  • hello i have also same problem thai is value is displayed at back end but not to the front end.
  • Hi Manisha,

    Did you try what I proposed in my previous post?

    All the best,
    Jen Peleva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items