More in this section

Forums / Developing with Sitefinity / Showing product file list on list view template?

Showing product file list on list view template?

2 posts, 0 answered
  1. Ryan
    Ryan avatar
    57 posts
    07 May 2013
    08 Apr 2014
    Link to this post

    Like the default product details template uses the <sf:ProductDocumentsAndFilesControl />, I want to show this same list of files/documents in the List view for products. 

     This is the list template, with the added control to show doucments and files, but I'm not sure how to specify ProductItem for the control. It shows up as blank when rendered. What do I need to reference on the list item template to feed into this control? Code is below. Thanks.

     <telerik:RadListView ID="productsListView"
                    <ul class="sfproductsList">
                        <asp:PlaceHolder ID="ProductContainer" runat="server" />
                    <li class="sfproductListItem">
                        <div class="sfproductTmbWrp">
                            <sf:DetailsViewHyperLink ID="thumbnailLink" runat="server" ImageUrl='<%# Eval("ThumbnailUrl") %>' Text='<%# Eval("ThumbnailAlternativeText") %>' ToolTip='<%# Eval("Title") %>' />
                        <h2 class="sfproductTitle">
                            <sf:DetailsViewHyperLink Text='<%# (Eval("Title").ToString()).TruncateString(56, SitefinityExtensions.TruncateOptions.IncludeEllipsis) %>' runat="server" CssClass="sfproductTitleLnk" />

                        <div class="sfProductDocumentsAndFiles">
                            <sf:ProductDocumentsAndFilesControl ID="productDocumentsAndFilesControl" ProductItem='<%# DataBinder.Eval(Container.DataItem, "") %>' runat="server" />

                        <div class="sfproductPrice">
                            <sfCatalog:DisplayPriceField ID="displayPriceField" ObjectType="Product" ObjectId='<%# Eval("Id") %>' runat="server" />
                        <%--NOTE: Uncomment the next line to display custom product fields--%>
                        <%--<sf:ProductDynamicFields id="productDynamicFields" runat="server"></sf:ProductDynamicFields>--%>

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    06 Sep 2017
    10 Apr 2014
    Link to this post
    Hi Ryan,

    I have tested the following code on the Sitefinity 6.3 and it shows all the related documents to the product:
    <div class="sfProductDocumentsAndFiles">
        <sf:ProductDocumentsAndFilesControl id="productDocumentsAndFilesControl" ProductItem='<%# Page.GetDataItem() %>' runat="server" />

    The code is get from the detail view of product detail view.

    Svetoslav Manchev
    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