+1-888-365-2779
Try Now
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
    Registered:
    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"
                runat="server"
                ItemPlaceholderID="ProductContainer"
                EnableEmbeddedSkins="false"
                EnableEmbeddedBaseStylesheet="false">
                <LayoutTemplate>
                    <ul class="sfproductsList">
                        <asp:PlaceHolder ID="ProductContainer" runat="server" />
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <li class="sfproductListItem">
                        <div class="sfproductTmbWrp">
                            <sf:DetailsViewHyperLink ID="thumbnailLink" runat="server" ImageUrl='<%# Eval("ThumbnailUrl") %>' Text='<%# Eval("ThumbnailAlternativeText") %>' ToolTip='<%# Eval("Title") %>' />
                        </div>
                        <h2 class="sfproductTitle">
                            <sf:DetailsViewHyperLink Text='<%# (Eval("Title").ToString()).TruncateString(56, SitefinityExtensions.TruncateOptions.IncludeEllipsis) %>' runat="server" CssClass="sfproductTitleLnk" />
                        </h2>

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


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

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    29 Nov 2016
    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" />
    </div>

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

    Regards,
    Svetoslav Manchev
    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
     
2 posts, 0 answered